Search code examples
asp.netasp.net-mvciis-6publish

Weird stack trace in exception "The incoming request does not match any route"


i have published asp.net mvc application on iis 6 on the server(windows server 2003) from local machine. On server i have set the default page to default.aspx. but when i try to browse the site on server, it gives me exception "The incoming request does not match any route" One thing i noticed is that. Stack trace on line 5 is shown below. it has one weird thing that exception is still pointing to my local machine path

[HttpException (0x80004005): The incoming request does not match any route.]
   System.Web.Routing.UrlRoutingHandler.ProcessRequest(HttpContextBase httpContext) +15589
   System.Web.Routing.UrlRoutingHandler.ProcessRequest(HttpContext httpContext) +40
   System.Web.Routing.UrlRoutingHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext context) +7
   **UserManagement._Default.Page_Load(Object sender, EventArgs e) in D:\Evoletpublishnew\UserManagement\UserManagement\Default.aspx.cs:18**
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +99
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

Solution

  • I solved it. I changed the global.asax registerroutes as follows:

    routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
    routes.MapRoute( "Default", "{controller}.mvc/{action}/{id}",
          new { action = "Index", id = "" }
       );
    routes.MapRoute( "Root", "",
          new { controller = "Account", action = "Index", id = "" }
       );