asp.net mvc4 添加分区出现错误 找到多个与名为“home”的控制器匹配的类型

时间:2015-03-09 17:29:13   收藏:0   阅读:2022
会出现如下错误”找到多个与名为“home”的控制器匹配的类型
 
在RouteConfig文件中添加命名空间可解决
 
routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                namespaces: new string[] { "Letter.Web.Controllers" }
            );
评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!