ASP MVC在IIS 7结果:HTTP错误403.14 - 禁止 [英] ASP MVC in IIS 7 results in: HTTP Error 403.14 - Forbidden
问题描述
我开发一个ASP MVC Web项目。现在我有迫使我部署到发展的IIS7 inmiddle的要求(检查某些功能)。我得到每当我试着输入网站的URL上面提到的错误消息。 (注:发展机:Vista家庭premium,IIS7)
I'm developing an ASP MVC web project. Now I have a requirement which forces me to deploy to an IIS7 inmiddle of development (to check some features). I'm getting the above mentioned error message whenever I try to type the URL of the web site. (Note: development machine: Vista Home Premium, IIS7)
我做了什么至今:
编辑HOSTS文件(C:\\ WINDOWS \\ SYSTEM32 \\ drivers \\ etc下\\主机)
Edited the HOSTS file (C:\WINDOWS\system32\drivers\etc\hosts).
把两个域在里面。(127.0.0.1 domain1.com和放大器; 127.0.0.1 domain2.com)
Put two domains in it (127.0.0.1 domain1.com & 127.0.0.1 domain2.com).
创建的文件夹C:\\网站\\ dirOfApplication并从Visual Studio 8中部署到该文件夹
Created a folder c:\websites\dirOfApplication and deployed from within Visual Studio 8 to this folder.
在IIS7创建了主机名称domain1.com和应用程序文件夹以上。
In IIS7 created a new site with host name domain1.com and application folder the above.
键入Web浏览器的结果地址domain1.com上述错误(HTTP错误403.14 - 禁止 - Web服务器配置为不列出此目录的内容)
Typing the address domain1.com in Web browser results in the above error (HTTP Error 403.14 - Forbidden - The Web server is configured to not list the contents of this directory.)
我想我失去了一些东西,但不知道是什么! Tryed部署文件System.Web.Mvc,System.Web.Abstraction&放大器; System.Web.Routing机智相同的结果。每当我试着打F5和运行应用程序,它工作正常!
I think I'm missing something but don't know what! Tryed to deploy the files System.Web.Mvc, System.Web.Abstraction & System.Web.Routing wit the same outcome. Whenever I try to hit F5 and run the application, it works fine!
推荐答案
也许是有用的人:
我的应用程序与IIS 7.0转换为MVC 4 .NET框架4.5和安装框架,我的服务器上后,我遇到的问题中提到的相同的'禁'的错误。我试图无济于事上述所有选项,当我注意到
Maybe it's useful to someone: After converting my app to MVC 4 with .NET framework 4.5 and installing the framework on my server with IIS 7.0 I encountered the same 'forbidden' error mentioned in the question. I tried all options described above to no avail, when I noticed the
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
从我的web.config失踪。
加上在此之后,一切正常。很简单,但容易忽视...
was missing from my web.config. After adding this, everything worked. Simple, but easy to overlook...
编辑:
当然,上述解决方案的工作,但它的确是一种资源的浪费。我觉得这是更好地添加为在评论中指出克里斯·赫林路由模块。
Of course the solution above will work, but it is indeed a waste of resources. I think it is better to add the routing module as pointed out by Chris Herring in the comments.
<system.webServer>
<modules>
<remove name="UrlRoutingModule-4.0" />
<add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
</modules>
</system.webServer>
这篇关于ASP MVC在IIS 7结果:HTTP错误403.14 - 禁止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!