Most of the time I write simple apps that run in the local ASP.NET development server.  I noticed when I started working with IIS more because of Windows Server AppFabric that my routes were not working when the web application is deployed in IIS.

For Visual Studio 2010 / .NET 4 and IIS 7.5 here is what I’ve learned.

Step 1 – Make sure that you have installed the HTTP Redirection feature

This one was the killer for me.  I didn’t realize that this is not setup by the Web Platform Installer.


Step 2 – Modify your web.config

You are going to need the following


<modules runAllManagedModulesForAllRequests="true">
<remove name="UrlRoutingModule"/>
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
verb="*" path="UrlRouting.axd"
type="System.Web.HttpForbiddenHandler, System.Web,
Version=, Culture=neutral,


Step 3 – Create your routes


new ServiceRoute("AdventureWorks",
new DataServiceHostFactory(),