asp.net-mvc 在 Windows 8 中的 IIS 8 上使用 .NET 4.5 的 MVC 4 网站给出 403.14 禁止错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14025455/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
MVC 4 website with .NET 4.5 on IIS 8 in Windows 8 gives 403.14 forbidden error
提问by RossD
I have a website that I built in Visual Studio 2012 using MVC 4 and .NET framework 4.5. When I try to run it via IIS 8 on a machine running Windows 8 Pro, I get a 403.14 Error. It says
我有一个使用 MVC 4 和 .NET 框架 4.5 在 Visual Studio 2012 中构建的网站。当我尝试在运行 Windows 8 Pro 的机器上通过 IIS 8 运行它时,出现 403.14 错误。它说
"Forbidden The Web server is configured to not list the contents of this directory.
“禁止 Web 服务器配置为不列出此目录的内容。
Most likely causes: A default document is not configured for the requested URL, and directory browsing is not enabled on the server."
最可能的原因:未为请求的 URL 配置默认文档,并且未在服务器上启用目录浏览。”
Here are some things I have tried that did not work:
以下是我尝试过的一些不起作用的事情:
- Run %windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -iand %windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -irin both this and the Framework64 directory. This gives this error: "This option is not supported on this version of the operating system. Administrators should instead install/uninstall ASP.NET 4.5 with IIS8 using the "Turn Windows Features On/Off" dialog, the Server Manager management tool, or the dism.exe command line tool. For more details please see http://go.microsoft.com/fwlink/?LinkID=216771." The link goes to a page about Windows Server 2012 which does not help. I could not find a specific setting in "Turn Windows Features on or off" dialog for iis 8. Everything relating to .net 4.5 is turned on.
- Add to in Web.config. This gives the error: "This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false"."
- 在此目录和 Framework64 目录中运行 %windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i和 %windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -ir。这会产生以下错误:“此版本的操作系统不支持此选项。管理员应改为使用“打开/关闭 Windows 功能”对话框、服务器管理器管理工具或使用 IIS8 安装/卸载 ASP.NET 4.5 dism.exe 命令行工具。有关详细信息,请参阅http://go.microsoft.com/fwlink/?LinkID=216771。该链接转到有关 Windows Server 2012 的页面,但没有帮助。我在 iis 8 的“打开或关闭 Windows 功能”对话框中找不到特定设置。与 .net 4 相关的所有内容。
- 添加到 Web.config 中。这会产生错误:“此配置部分不能在此路径上使用。当该部分在父级别锁定时会发生这种情况。锁定是默认情况下(overrideModeDefault="Deny"),或由具有 overrideMode 的位置标记显式设置="拒绝" 或遗留的 allowOverride="false"。"
I have made sure .net 4.5 is installed on the server (the installer said it is built into windows 8 and does not need to be installed). The application pool is the default pool using .net 4.0, integrated pipeline, with 32 bit applications enabled. I'm publishing to the default directory (inetpub\wwwroot) and the default site that was there worked fine. HTTP Redirection is turned on in "Turn windows features on or off"
我已经确保服务器上安装了 .net 4.5(安装程序说它内置于 Windows 8 中,不需要安装)。应用程序池是使用 .net 4.0、集成管道的默认池,启用了 32 位应用程序。我正在发布到默认目录 (inetpub\wwwroot) 并且那里的默认站点运行良好。HTTP 重定向在“打开或关闭 Windows 功能”中打开
Can anyone offer any more insights?
谁能提供更多见解?
EDIT: Well, of course right after I post this I found something that works. Go figure.
编辑:嗯,当然,在我发布这篇文章之后,我发现了一些有用的东西。去搞清楚。
In "Turn Windows Features on or off", under Internet Information Services -> World Wide Web Services -> Application Development Features, make sure that .NET Extensibility 3.5, .NET Extesibility 4.5, ASP.NET 3.5, ASP.NET 4.5, ISAPI Extensions, and ISAPI Filters are SELECTED.
在“打开或关闭 Windows 功能”中,在 Internet 信息服务 -> 万维网服务 -> 应用程序开发功能下,确保 .NET Extensibility 3.5、.NET Extesibility 4.5、ASP.NET 3.5、ASP.NET 4.5、ISAPI扩展和 ISAPI 过滤器是 SELECTED。
This was outlined here: http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-using-aspnet-35-and-aspnet-45#TOC301258515but since that refered to server 2012 instead of windows 8 I couldn't find the right location for these settings.
这在这里概述:http: //www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-using-aspnet-35-and-aspnet-45#TOC301258515但由于指的是 server 2012 而不是 windows 8 我找不到这些设置的正确位置。
Hope this helps anyone with a similar problem. Thanks for reading.
希望这可以帮助任何有类似问题的人。谢谢阅读。
回答by Eduardo Molteni
In "Turn Windows Features on or off", under Internet Information Services -> World Wide Web Services -> Application Development Features, make sure that .NET Extensibility 3.5, .NET Extesibility 4.5, ASP.NET 3.5, ASP.NET 4.5, ISAPI Extensions, and ISAPI Filters are SELECTED.
在“打开或关闭 Windows 功能”中,在 Internet 信息服务 -> 万维网服务 -> 应用程序开发功能下,确保 .NET Extensibility 3.5、.NET Extesibility 4.5、ASP.NET 3.5、ASP.NET 4.5、ISAPI扩展和 ISAPI 过滤器是 SELECTED。
This was outlined here: http://www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-using-aspnet-35-and-aspnet-45#TOC301258515but since that refered to server 2012 instead of windows 8 I couldn't find the right location for these settings.
这在这里概述:http: //www.iis.net/learn/get-started/whats-new-in-iis-8/iis-80-using-aspnet-35-and-aspnet-45#TOC301258515但由于指的是 server 2012 而不是 windows 8 我找不到这些设置的正确位置。
Note: Answer added to clean the question from unanswered
注意:添加了答案以清除未回答的问题

