问题描述
所以我有所有更新的代码,整个解决方案构建.它适用于其他人的机器,但是当我尝试在我的机器上访问 localhost/extranet
时,它给了我这个错误:
So I have all the updated code, the entire solution builds. It works on everyone else's machine, however when I try and access localhost/extranet
on my machine, it gives me this error:
HTTP 错误 403.14 - 禁止
HTTP Error 403.14 - Forbidden
详细错误信息:
Module DirectoryListingModule
Notification ExecuteRequestHandler
Handler 0x00000000
Requested URL http://localhost:80/extranet/
Physical Path C:svnK2 runkappteamwebChatham.Web.UI.Extranet
Logon Method Anonymous
Logon User Anonymous
现在我尝试进入 IIS7,并启用目录浏览,这消除了错误,但仍然没有显示我的网站.我还尝试进入并禁用默认文档,重新启用它,一切都没有奏效.我也重新启动了几次 IIS,但无济于事.
Now I tried going into IIS7, and enabling directory browsing, this removed the error, but still didn't bring up my website. I also tried going in and disabling the default document, re-enabling it, everything, nothing worked. I've also restarted IIS a few times to no avail.
有什么想法吗?
推荐答案
听起来你的 IIS 没有为你的应用程序处理路由规则,而是试图找到一个 default.aspx、index.htm 等.因为它不能,它想要显示目录列表(这就是你得到 404.14 的原因).
It sounds like your IIS is not processing the routing rules for your application and is trying to find a default.aspx, index.htm, etc. Since it cannot, it is wanting to display the directory listings (which is why you were getting the 404.14).
我刚刚检查了我的开发设置,我认为您的 AppPool 必须设置为 Integrated 而不是 AppPool 的托管管道上的 Classic.我以前遇到过这种情况,可能有使用经典管道的方法,但这将/应该是解决您的问题的最快方法.要检查/更改管道模式,请从 IIS 左侧的菜单中单击应用程序池,找到您的 AppPool 并查看托管管道列.如果设置为 Classic -> 右键单击 AppPool,选择基本设置,然后将下拉菜单从 Classic 更改为 Integrated.
I just checked my dev setup and I think that your AppPool has to be set on Integrated as opposed to Classic on the Managed Pipeline for the AppPool. I have ran into this before, there may be ways to use the Classic Pipeline, but this would/should be the quickest way to resolve your issue. To check/change the pipeline mode, click on Application Pools from the menu on the left side of IIS, find your AppPool and look in the managed pipeline column. If it is set to Classic -> Right click the AppPool, choose basic settings, then change the dropdown from Classic to Integrated.
如果我不正确,请随时在评论中纠正我.
If I am incorrect, someone please feel free to correct me on this in the comments.
编辑 - 只是添加,您可以在经典管道模式下运行 MVC 应用程序,但您必须执行 IIS 6 技巧才能使其正常工作.主要是,您需要打开通配符脚本映射以使 MVC 在经典模式下工作,否则它需要一个 .aspx 文件(或类似文件)来处理从 IIS 到 .NET 的执行管道.
Edit - Just to add, you can run an MVC app in the Classic Pipeline mode, but you have to do the IIS 6 tricks to get it to work properly. Mainly, you need to turn on wildcard script mapping for MVC to work in Classic mode, If not it expects an .aspx file (or similar) to exist for it to handle the execution pipeline over to .NET from IIS.
这篇关于HTTP 错误 403.14 - 访问网站时出现禁止错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!