发布 Kentico CMS 9 - 异常 WebFarmTaskManager.CanCreateTask
Publishing Kentico CMS 9 - Exception WebFarmTaskManager.CanCreateTask
任何人都可以帮助我发布 Kentico CMS 9。当我从 visual studio 发布应用程序并上传到服务器时,我收到了这个异常:
当我将文件从我计算机中的开发人员文件夹上传到同一个虚拟主机时,一切运行良好。
你能帮帮我吗?
这可能是一个不是内置的错误,Kentico 9 仍然是新的,因此您可能希望将其记录为错误。
否则虽然我相信在启动的某个地方你确实需要使用 WebFarmHelper.RegisterTask 来注册农场任务,也许你可以尝试使用自定义加载器模块添加该代码,因为它在启动时运行.
https://docs.kentico.com/display/K9/Handling+global+events
using CMS.Base;
using CMS.DocumentEngine;
[CustomDocumentEvents]
public partial class CMSModuleLoader
{
/// <summary>
/// Attribute class that ensures the loading of custom handlers.
/// </summary>
private class CustomDocumentEventsAttribute : CMSLoaderAttribute
{
/// <summary>
/// The system executes the Init method of the CMSModuleLoader attributes when the application starts.
/// </summary>
public override void Init()
{
// Call WebFarmHelper.RegisterTask here
}
}
}
问题在于只发布了解决方案中两个项目中的一个。
来自 Kentico 9 发布文档:
Publishing web application projects
If you plan to publish from Visual Studio, we recommend installing Kentico projects with the web site configuration.
To use the Publish function of Visual Studio for Kentico web application projects, you need to sequentially publish all of the projects in the solution to the same target location:
CMSApp
CMSApp_AppCode
After deploying the first project, make sure that your publish profile has the Delete all existing files prior to publish / Remove additional files at destination option disabled. You can configure the option in the Publish Web dialog in Settings -> File Publish Options.
谢谢大卫·斯拉维克。
如您所说,先发布 CMSApp_AppCode,然后在同一文件夹 CMSApp 中发布,但请注意选项 "Delete all existing files prior to publish" 已禁用。
任何人都可以帮助我发布 Kentico CMS 9。当我从 visual studio 发布应用程序并上传到服务器时,我收到了这个异常:
当我将文件从我计算机中的开发人员文件夹上传到同一个虚拟主机时,一切运行良好。
你能帮帮我吗?
这可能是一个不是内置的错误,Kentico 9 仍然是新的,因此您可能希望将其记录为错误。
否则虽然我相信在启动的某个地方你确实需要使用 WebFarmHelper.RegisterTask 来注册农场任务,也许你可以尝试使用自定义加载器模块添加该代码,因为它在启动时运行.
https://docs.kentico.com/display/K9/Handling+global+events
using CMS.Base;
using CMS.DocumentEngine;
[CustomDocumentEvents]
public partial class CMSModuleLoader
{
/// <summary>
/// Attribute class that ensures the loading of custom handlers.
/// </summary>
private class CustomDocumentEventsAttribute : CMSLoaderAttribute
{
/// <summary>
/// The system executes the Init method of the CMSModuleLoader attributes when the application starts.
/// </summary>
public override void Init()
{
// Call WebFarmHelper.RegisterTask here
}
}
}
问题在于只发布了解决方案中两个项目中的一个。
来自 Kentico 9 发布文档:
Publishing web application projects If you plan to publish from Visual Studio, we recommend installing Kentico projects with the web site configuration. To use the Publish function of Visual Studio for Kentico web application projects, you need to sequentially publish all of the projects in the solution to the same target location: CMSApp CMSApp_AppCode After deploying the first project, make sure that your publish profile has the Delete all existing files prior to publish / Remove additional files at destination option disabled. You can configure the option in the Publish Web dialog in Settings -> File Publish Options.
谢谢大卫·斯拉维克。 如您所说,先发布 CMSApp_AppCode,然后在同一文件夹 CMSApp 中发布,但请注意选项 "Delete all existing files prior to publish" 已禁用。