You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

检索页面模板报错: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.Mvc NuGet包,不存在版本冲突
  • 若使用ASP.NET Core版本的Kentico Xperience,需确认服务注册代码中已添加AddPageBuilder()配置
  • 清理浏览器缓存和站点临时文件后重试

内容的提问来源于stack exchange,提问作者Asad Iftikhar

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.27 18:54:05