System.Web.Routing只能用.aspx文件扩展名工作 [英] System.Web.Routing only working with a .aspx file extension
问题描述
我有一个应用程序,使用 System.Web.Routing
,它在我的所有环境的伟大工程。唯一的问题是,我的临时环境需要的.aspx末或我会得到一个404的所有其他环境并不需要它。他们都在经典与4.0版的.NET框架托管管道模式下运行。我一直比较IIS设置,但我找不到任何差异。我甚至比的web.config
和的machine.config
,但无论是无差异存在。任何人都知道这可能是什么?
I have an application, that uses System.Web.Routing
and it works great on all my environments. The only issue is, that my staging environment needs the ".aspx" at the end or I will get a 404. All other environments do not require it. They all run in Classic for the Managed Pipeline Mode with v4.0 .NET framework. I keep comparing IIS settings, but I can't find any differences. I've even compared web.config
and machine.config
, but no differences there either. Anybody know what it could be?
推荐答案
请确保您有这方面在你的web.config(而且通常你想集成,除非你不能因为某些原因和<一个href=\"http://www.asp.net/mvc/tutorials/older-versions/deployment/using-asp-net-mvc-with-different-versions-of-iis-cs\"相对=nofollow>通过跳火圈因此它可以在经典)。
Make sure you have this in your web.config (and normally you do want Integrated, unless you can't for some reason and jump through the hoops so it works under Classic).
<system.webServer>
<!-- omitted for brevity -->
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
runaAllManagedModulesForAllRequests
已经得到了我几次了过去。
runaAllManagedModulesForAllRequests
has gotten me a couple times in the past.
这篇关于System.Web.Routing只能用.aspx文件扩展名工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!