首页 > 解决方案 > 无法加载类型“NewSite.MvcApplication”kentico

问题描述

我对此很陌生。我新安装了 kentico cms,它托管在 IIS 服务器中,每当我尝试访问 localhost 网站时,我都会收到此错误。在此处输入图像描述

这是我的 Global.asax.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;

using Kentico.Web.Mvc;

namespace NewSite
{
    public partial class MvcApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            // Enables and configures selected Kentico ASP.NET MVC integration features
            ApplicationConfig.RegisterFeatures(ApplicationBuilder.Current);

            // Registers routes including system routes for enabled features
            RouteConfig.RegisterRoutes(RouteTable.Routes);

            // Registers enabled bundles
            BundleConfig.RegisterBundles(BundleTable.Bundles);
        }
    }
}

这是我的 Global.asax

<%@ Application Codebehind="Global.asax.cs" Inherits="NewSite.MvcApplication" Language="C#" %>

我在这里错过了什么,请提供任何帮助。我现在被困在这里几个小时

标签: c#iiskentico

解决方案


最后我找到了一个解决方案,我不知道这是解决这个问题的最佳方法,因为我是新手。

我变了

Codebehind="Global.asax.cs"

CodeFile="Global.asax.cs"

在 Global.asax 文件中

它正在工作。

如果这不是一个好的解决方案,请告诉我。


推荐阅读