2010-06-11 33 views
0

我已经在本地机器上的服务器(Windows Server 2003)上的iis 6上发布了asp.net mvc应用程序。在服务器上,我已将默认页面设置为default.aspx。但是当我尝试浏览服务器上的网站时,它给了我例外 “传入的请求不匹配任何路由” 我注意到的一件事是。第5行的堆栈跟踪如下所示。它有一个例外,仍然是指向我的本地机器路径异常中的奇怪堆栈跟踪“传入的请求不匹配任何路由”

[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 
+0

2件事。你建立了什么路线以及你试图访问什么路线? – 2010-06-11 05:33:05

+0

请参阅下面的评论我已经显示我的maprroute。当我尝试访问服务器上的http:\\ localhost:8800时发生上述异常。如果我访问http:\\ localhost:8800 \ account.mvc它工作正常 – Tassadaque 2010-06-11 05:38:52

回答

0

我解决了它。我改变了global.asax寄存路由如下:

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 = "" } 
    ); 
0

没有被忽略需要映射到一些控制器和行动,这你可能丢失的所有请求一个奇怪的事情。通常情况下,默认路由看起来是这样的,并会在你的路由表中的最后一项:

routes.MapRoute("Default", "{controller}/{action}/{id}", 
    new { controller = "Home", action = "Index", id = "" } 
); 

你看到你的本地计算机的参考是从组装编译的文件只是位置。

+0

我认为它已经在那里。请看看我的注册路由器 public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute(“{resource} .axd/{* pathInfo}”); routes.MapRoute( “Default”,//路线名称 “{controller} .mvc/{action}/{id}”,//带参数的网址 新{controller =“account”,action =“Index “,id =”“} //参数默认值 ); – Tassadaque 2010-06-11 05:32:24

+0

你的Default.aspx包含什么? – dahlbyk 2010-06-11 05:42:17

+0

我没有改变任何它默认为asp.net mvc生成的 – Tassadaque 2010-06-11 05:47:26

相关问题