[英]Url Routing (ASP.NET 4 Web Forms) returning 404 under IIS7 (Win2008) but OK under IIS7.5 (Win7)?
I have an asp.net 4 website that is working fine locally under IIS7.5 (windows 7), and under the Classic Application Pool (albeit .NET 4). 我有一个asp.net 4网站,该网站在IIS7.5(Windows 7)和经典应用程序池(尽管.NET 4)下在本地运行良好。
Some of the site uses routing and some of the older sections of the site don't. 该网站的某些部分使用路由,而该网站的某些较旧的部分则不使用路由。 Anyway, it all works fine locally.
无论如何,在本地都可以正常工作。
I have just deployed this to our live webserver for the first time since introducing the routing parts of the site, and all I get is 404's for the sections of the site that are using Routing. 自介绍网站的路由部分以来,我第一次将其部署到我们的实时Web服务器中,而我所获得的只是使用路由的网站部分的404。
The live webserver is IIS7 on Windows 2008, and again is set to use a .NET4 Classic App Pool. 实时网络服务器是Windows 2008上的IIS7,并且再次设置为使用.NET4经典应用程序池。
I have tried adding <modules runAllManagedModulesForAllRequests="true">
under the system.webserver section of my web.config, but this doesn't appear to have made any difference. 我尝试在我的web.config的system.webserver部分下添加
<modules runAllManagedModulesForAllRequests="true">
,但这似乎没有任何区别。
Can anyone shed some light on what the problem might be/how to get around this please? 任何人都可以阐明问题可能在哪里/如何解决这个问题?
我想我通过再次运行aspnet_regiis
(在.Net Framework v4文件夹中)解决了此问题。
The only way I've been able to get around this unfortunately is by adding a wildcard script mapping in IIS7 as per this article: 不幸的是,我能够解决此问题的唯一方法是按照本文在IIS7中添加通配符脚本映射:
http://learn.iis.net/page.aspx/508/wildcard-script-mapping-and-iis-7-integrated-pipeline/ http://learn.iis.net/page.aspx/508/wildcard-script-mapping-and-iis-7-integrated-pipeline/
This has at least got the pages routing successfully, even if it does feel a little dirty. 这至少使页面成功路由,即使确实感到有些脏。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.