Por*_*man 63 iis visual-studio-2010 visual-studio iis-7.5 asp.net-mvc-2
我试图在Windows 7上的IIS下运行ASP.NET MVC 2 Web应用程序,但是我收到403.14错误.以下是重现的步骤:
http://localhost:{random_port}/
并且页面将正确呈现.http://localhost/MvcApplication1/
和IIS错误HTTP Error 403.14 - Forbidden The Web server is configured to not list the contents of this directory.
.很明显,无论出于何种原因,ASP.NET路由都无法正常工作.
我已经想过并尝试过的事情:
aspnet_regiis -i
在v4.0.30319
目录中.这是最神奇的部分 - 这是在一台刚刚建造的机器上.Windows 7 x64 Ultimate的新副本,Visual Studio 2010 Premium的全新安装,没有其他网站,也没有执行其他工作.
还有什么我可以尝试的吗?
将Visual Studio设置为使用本地IIS Web服务器http://i41.tinypic.com/11j176b.png
Por*_*man 86
好的,通过执行以下操作,我可以解决这个问题:
aspnet_regiis -i
在32位目录中运行c:\Windows\Microsoft.NET\Framework\v4.0.30319
.
此时,我不明白为什么64位模式不起作用,但我现在已经解锁了.希望这有助于其他任何有此问题的人.
Tom*_*ler 46
我有完全相同的问题,谢谢你的帮助.
但是...您是否尝试aspnet_regiis -i
在Visual Studio 64位命令提示符下运行该命令(具有管理员权限)?当我这样做时,它修复了64位模式.
为了澄清,我右键单击Visual Studio x64 Win64 Command Prompt (2010)
并选择以管理员身份运行.然后我去了这里:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319
Run Code Online (Sandbox Code Playgroud)
这样做了: aspnet_regiis -i
现在它完美无缺.
Roh*_*est 27
还要确保配置文件具有以下行,否则路由将不起作用.
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
Run Code Online (Sandbox Code Playgroud)
不要使用runAllManagedModulesForAllRequests.您希望让IIS处理图像等资源.
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
Run Code Online (Sandbox Code Playgroud)
而是添加MVC路由模块
<system.webServer>
<modules>
<remove name="UrlRoutingModule-4.0" />
<add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="" />
</modules>
</system.webServer>
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
49454 次 |
最近记录: |