2013-05-02 98 views
1

我有一个最初在IIS 7.5上开发的ASP.NET MVC4 web应用程序。 RouteConfig:iis8上的asp.net mvc4默认控制器

routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); 

AreaRegistration.RegisterAllAreas(); 

routes.MapRoute(
    name: "Default", 
    url: "{controller}/{action}/{id}", 
    defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } 
); 

AdminAreaRegistration:

context.MapRoute(
    name: "Admin", 
    url: "Admin/{controller}/{action}/{id}", 
    defaults: new { controller = "AdminIndex", action = "Index", id = UrlParameter.Optional }, 
    namespaces: new[] { "Web.Areas.Admin.Controllers" } 
); 

在IIS 7.5中的一切工作正常。在部署到IIS 8 url/Admin /返回错误403之后。但是,如果指定了控制器名称,它将起作用:/ Admin/AdminIndex /。有任何想法吗?提前致谢。

+0

作为一个临时解决方案更新的web.config用: <添加URL = “〜/系统管理员” mappedUrl = “〜/管理/ AdminIndex”/> 它现在工作。 – SergB 2013-05-03 10:08:25

回答

0

尝试改变路线的顺序。

+0

全部保持不变:IIS 7.5工作,IIS 8不工作。 – SergB 2013-05-02 14:59:01