How to run ASP.NET MVC app in IIS 10 on Windows 10(如何在 Windows 10 上的 IIS 10 中运行 ASP.NET MVC 应用程序)
问题描述
我通过 windows 功能安装了 IIS 10 并将 MVC 应用程序发布到 IIS 文件夹中,然后执行dism/online/enable-feature/featurename:IIS-ASPNET45"命令但仍然出现错误:
I installed IIS 10 through windows features and published MVC app into the IIS folder, then executed "dism /online /enable-feature /featurename:IIS-ASPNET45" command but still getting error:
HTTP 错误 403.14 - 禁止Web 服务器配置为不列出该目录的内容
HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory
我在 Windows 7 中使用aspnet_regiis -I"命令而不是dism/online/enable-feature/featurename:IIS-ASPNET45"完成了此操作,并且从 localhost 加载了 Web 应用程序,但我似乎无法让它在 Windows 10 上运行.
I've done this in windows 7 with "aspnet_regiis -I" command instead of "dism /online /enable-feature /featurename:IIS-ASPNET45" and web app loaded just fine from localhost, but I can't seem to get this to work on Windows 10.
推荐答案
我遇到了同样的问题,我通过使用 Win10 GUI 选择已安装的功能解决了这个问题.Internet 信息服务 ->万维网服务 ->应用程序开发功能->ASP.NET 4.6
未选中.与我需要的其他几个一起检查了,一切都很好.
I had the same problem and I solved it by using the Win10 GUI for selecting installed features. Internet Information Services -> World Wide Web Service -> Application Development Features->ASP.NET 4.6
was not checked. Checked that along with a few others I needed and all was good.
这篇关于如何在 Windows 10 上的 IIS 10 中运行 ASP.NET MVC 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!