Multiple types were found that match the controller named 'Customer'. This can happen if the route that services this request ('{controller}/{action}/{id}') does not specify namespaces to search for a controller that matches the request. If this is the case, register this route by calling an overload of the 'MapRoute' method that takes a 'namespaces' parameter. The request for 'Customer' has found the following matching controllers: OpenCart.Cotrollers.CustomerController OpenCart.Areas.Admin.Controllers.CustomerController
my routes is follow:
routes.MapRoute( "Default", // 路由名称 "{controller}/{action}/{id}", // 带有参数的 URL new { controller = "Home", action = "Index", id = UrlParameter.Optional }, // 参数默认值 namespaces: new string[] { "OpenCart.Controllers" }//设置域,与Admin区分 );
and areas routes:
context.MapRoute( "Admin_default", "Admin/{controller}/{action}/{id}",//Admin路由 new { action = "Index", id = UrlParameter.Optional },//默认参数 namespaces: new string[] { "OpenCart.Areas.Admin.Controllers" }//**设置该路由所对应的Controller );
but when I request /Customer/Register it do not work~Why?