System.Web.Routing only working with a .aspx file extension

China☆狼群 提交于 2019-12-25 05:16:11

问题


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?


回答1:


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 has gotten me a couple times in the past.



来源:https://stackoverflow.com/questions/11018420/system-web-routing-only-working-with-a-aspx-file-extension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!