I have a client who has one webpage with customized routes added in global.asax (they are extension-less):
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
Routing.RouteTable.Routes.Clear()
Routing.RouteTable.Routes.MapPageRoute("Key1", "String", "~/Route")
Unfortunately this redirections are not working on IIS 7.5. I’ve tested that:
- HTTP redirection is installed over IIS
- Tried to runAllManagedModulesForAllRequests=”true” (in the web.config)
- Use the manual add of UrlRoutingMode (http://www.britishdeveloper.co.uk/2010/06/dont-use-modules-runallmanagedmodulesfo.html)
The pool in in integrated mode, 4.0. This server is running a lot of MVC3 pages, and they are using routing by default.
Any light will be very apreciated! Thanks
======================================================================
EDIT: Ok, I’m not able to find any solution.
At the webconfig, inside assemblies:
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
At system.webServer:
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<defaultDocument>
<files><add value="Page.aspx" /></files>
</defaultDocument>
<modules runAllManagedModulesForAllRequests="true">
<remove name="UrlRoutingModule"/>
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule,System.Web.Routing,Version=4.0.0.0,Culture=neutral,PublicKeyToken=31BF3856AD364E35" />
</modules>
</system.webServer>
My solution, after trying EVERYTHING:
Bad deployment, an old PrecompiledApp.config was hanging around my deploy location, and making everything not work.
My final settings that worked:
Nothing changes in the web.config – this means no special handlers for routing. Here’s my snapshot of the sections a lot of other posts reference. I’m using FluorineFX, so I do have that handler added, but I did not need any others:
Global.ashx: (only method of any note)
PassthroughRouteHandler.cs – this achieved an automatic conversion from http://andrew.arace.info/stackoverflow to http://andrew.arace.info/#stackoverflow which would then be handled by the default.aspx: