Geeks With Blogs
Ben Bastiaensen Living the .NET live

URL Routing is a very nice new feature in ASP.NET 4.0. And in Visual Studio everything works just great. But as soon as you start testing on IIS you get a "Error 404.0 - Not Found".

To solve this you need to make sure that:

  1. you have set the Application Pool to " 4.0 application pool". Routing will not work with " 4.0 classic application pool".
  2. you add the following code to your web.config:

    <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, 

Routing should work in IIS as well now. Hope it helps.

Posted on Thursday, April 21, 2011 4:42 AM ASP.NET | Back to top

Comments on this post: ASP.NET 4.0 URL Routing HTTP Error 404.0 - Not Found

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Ben Bastiaensen | Powered by: