检索页面模板报错:MVC项目如何正确注册Page builder功能
问题解决方法
报错原因:系统提示无法检索页面模板,本质是MVC项目中Kentico的页面构建器功能未完成注册,你当前的配置文件中对应注册代码处于注释状态。
解决步骤
- 打开你的ApplicationConfig文件,找到
RegisterFeatures方法 - 删除
//builder.UsePageBuilder();行开头的注释符//,启用页面构建器注册 - 可选:如果后续需要使用调度器功能,也可同步取消
builder.UseScheduler();的注释 - 保存文件后重新编译项目,重启站点再进行操作即可
修正后的配置代码示例
public class ApplicationConfig { public static void RegisterFeatures(IApplicationBuilder builder) { // Enable required Kentico features // Uncomment the following to use the Page builder feature builder.UsePageBuilder(); //builder.UseScheduler(); builder.UsePageRouting(new PageRoutingOptions { //EnableAlternativeUrls = true }); } }
额外排查项(修改基础配置后仍报错可检查)
- 确认项目已安装对应版本的
Kentico.PageBuilder.Web.MvcNuGet包,不存在版本冲突 - 若使用ASP.NET Core版本的Kentico Xperience,需确认服务注册代码中已添加
AddPageBuilder()配置 - 清理浏览器缓存和站点临时文件后重试
内容的提问来源于stack exchange,提问作者Asad Iftikhar
相关产品推荐
相关产品推荐

