如何在 Windows 10 上的 IIS 10 中运行 ASP.NET MVC 应用程序

How to run ASP.NET MVC app in IIS 10 on Windows 10(如何在 Windows 10 上的 IIS 10 中运行 ASP.NET MVC 应用程序)
本文介绍了如何在 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 应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
how do i pass parameters to aspnet reportviewer(如何将参数传递给aspnet report查看器)
Bind multiple parameters from route and body to a model in ASP.NET Core(在ASP.NET Core中将路由和主体中的多个参数绑定到一个模型)
Custom model binding in AspNet Core WebApi?(AspNet Core WebApi中的自定义模型绑定?)
How to minify in .net core mvc view?(如何在.Net核心MVC视图中缩小?)