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 e开发者_如何转开发xception 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
All requests that aren't ignored need to map to some controller and action, which you are probably missing. Typically the default route looks like this and would be the last entry in your route table:
routes.MapRoute("Default", "{controller}/{action}/{id}",
new { controller = "Home", action = "Index", id = "" }
);
The reference you're seeing to your local machine is just the location of the file from which the assembly was compiled.
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 = "" }
);
精彩评论