【问题标题】:Could not load type 'NewSite.MvcApplication' kentico无法加载类型“NewSite.MvcApplication”kentico
【发布时间】:2019-12-04 06:21:00
【问题描述】:

我对这个很陌生。我新安装了 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#" %>

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

【问题讨论】:

  • 您的应用程序中真的有NewSite.MvcApplication 类吗?如果不是,请创建相同的并编译项目。它肯定会起作用。还要检查项目输出路径(项目属性/构建)是否设置为 bin 而不是 bin\Release 或 bin\Debug。出于某种原因,IIS(VS 开发服务器或本地 IIS)总是从 bin 目录访问库(并且不会查找子目录)

标签: c# iis kentico


【解决方案1】:

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

我变了

Codebehind="Global.asax.cs"

CodeFile="Global.asax.cs"

在 Global.asax 文件中

它正在工作。

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-08-14
    • 2015-08-28
    • 2016-03-05
    • 2014-08-09
    • 2015-04-16
    • 2010-09-08
    • 2017-04-13
    • 2014-01-03
    相关资源
    最近更新 更多