【发布时间】: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 目录访问库(并且不会查找子目录)