Asp.net mvc 独立IIS服务器无法根据启动url/启动url/默认视图启动web应用程序

Asp.net mvc 独立IIS服务器无法根据启动url/启动url/默认视图启动web应用程序,asp.net-mvc,iis,view,routes,url-routing,Asp.net Mvc,Iis,View,Routes,Url Routing,我们使用以下技术开发了ASP.NET MVC 5.2.7.0版应用程序: -ASP.NET MVC 5.2.7.0版 -.NET Framework 4.6.1 -Visual Studio 2019 我们必须将上述应用程序部署到包含独立IIS服务器的以下环境中: -32位环境 -Windows Server 2008 R2企业版(Service Pack 1) -IIS 7.5版 还安装了.NET Framework 4.6.1运行时和SDK -8GB内存 这是一个典型的ASP.NET M

我们使用以下技术开发了ASP.NET MVC 5.2.7.0版应用程序:

-ASP.NET MVC 5.2.7.0版

-.NET Framework 4.6.1

-Visual Studio 2019

我们必须将上述应用程序部署到包含独立IIS服务器的以下环境中:

-32位环境

-Windows Server 2008 R2企业版(Service Pack 1)

-IIS 7.5版

  • 还安装了.NET Framework 4.6.1运行时和SDK
-8GB内存

这是一个典型的ASP.NET MVC设置和配置:

当我在VisualStudio2019调试模式下运行它时,它会工作,因为它会显示带有应用程序标题的默认登录页

但是,当我将其部署到独立的IIS服务器上,并仅在IIS管理器中单击“浏览”时,会出现以下错误:

HTTP错误403.14-禁止

未为请求的URL配置默认文档,并且 服务器上未启用目录浏览

这真的很奇怪,因为独立IIS服务器上的应用程序有一个bin目录,其中包含ASP.NET MVC所需的必要文件:

System.Web.Helpers.dll System.Web.Http.dll System.Web.Http.WebHost.dll System.Web.Mvc.dll System.Web.Optimization.dll System.Web.Razor.dll System.Web.WebPages.Deployment.dll
System.Web.WebPages.dll System.Web.WebPages.Razor.dll System.Xml.ReaderWriter.dll System.Xml.XDocument.dll System.Xml.XmlDocument.dll System.Xml.XmlSerializer.dll System.Xml.XPath.dll System.Xml.XPath.XDocument.dll


有人能告诉我如何在独立IIS服务器上解决上述错误吗?

原因可能很简单,我们需要启用某些windows功能以支持Asp.NET平台web应用程序。



如果问题仍然存在,请随时通知我

这回答了你的问题吗?Visual Studio有能力解析代码并知道使用什么作为默认页面,但IIS没有。在这个问题中,您将看到我的RouteConfig的RegisterRoutes方法已经定义了“默认”路由。但是,我仍然得到“403.14-禁止”,“没有为请求的URL配置默认文档,并且服务器上没有启用目录浏览。”仔细阅读链接的线程。这条路线不同。
public class WebApiApplication : System.Web.HttpApplication
{
    protected void Application_Start()
    {
        AreaRegistration.RegisterAllAreas();
        GlobalConfiguration.Configure(WebApiConfig.Register);
        FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
        RouteConfig.RegisterRoutes(RouteTable.Routes);
        BundleConfig.RegisterBundles(BundleTable.Bundles);
    }
}


public class RouteConfig
{
    public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

        routes.MapRoute(
            name: "Default",
            url: "{controller}/{action}/{id}",
            defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
        ); ................................... .................................................