title: ASP.NET MVC on IIS 6 - wildcard mapping - the incoming request does not match any route
body: <p>I have been trying to set up my Beta 1 MVC app on IIS 6 and cannot get it to run correctly. I have added a Wildcard mapping to the .net isapi DLL as suggested in other blog posts but get the following error when I access the root of the website:</p>
  
  <pre><code>The incoming request does not match any route.
  ..
  [HttpException (0x80004005): The incoming request does not match any route.]
     System.Web.Routing.UrlRoutingHandler.ProcessRequest(HttpContextBase httpContext) +147
     System.Web.Routing.UrlRoutingHandler.ProcessRequest(HttpContext httpContext) +36
     System.Web.Routing.UrlRoutingHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext context) +4
     HCD.Intranet.Web.Default.Page_Load(Object sender, EventArgs e) +81
     System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
     System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +33
     System.Web.UI.Control.OnLoad(EventArgs e) +99
     System.Web.UI.Control.LoadRecursive() +47
     System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436
  </code></pre>
  
  <p>I am using the Default.aspx page supplied in the MVC template application that rewrites access to the root of the website properly.</p>
  
  <pre><code>public partial class Default : Page
  {
      public void Page_Load(object sender, System.EventArgs e)
      {
          HttpContext.Current.RewritePath(Request.ApplicationPath);
          IHttpHandler httpHandler = new MvcHttpHandler();
          httpHandler.ProcessRequest(HttpContext.Current);
      }
  }
  </code></pre>
  
  <p>If I try and access a route within the application, such as /Project, I get the standard IIS 404 error page, not the .net error page.</p>
  
  <p>I tried adding the following line to my Web.config httpHandlers section:</p>
  
  <pre><code>&lt;add verb="*" path="*" validate="false" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&gt;
  </code></pre>
  
  <p>This gave me a different error - the .net 404 error page.</p>
  
  <p>I added the following to my Global.asax, which did nothing:</p>
  
  <pre><code>protected void Application_BeginRequest(object sender, EventArgs e)
  {
      if (Context.Request.FilePath.Equals("/"))
          Context.RewritePath("Default.aspx");
  }
  </code></pre>
  
  <p>I am using the following route configuration (uses the restful routing supplied by the MvcContrib project):</p>
  
  <pre><code>routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  SimplyRestfulRouteHandler.BuildRoutes(routes);
  routes.MapRoute(
  "Default", 
  "{controller}/{action}/{id}",
  new { controller = "Home", action = "Index", id = "" }
  );
  </code></pre>
  
  <p>Any suggestions would be grealy received as I've exhausted all options for the time I have right now.</p>
  
  <p>Many thanks.</p>