Thursday, 9 February 2012

Areas duplicated: Multiple types were found that match the controller named 'Home'.

Problem:

Multiple types were found that match the controller named 'Home'. 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 'Home' has found the following matching controllers:
Project.Web.Controllers.HomeController
Project.Web.Areas.Dashboard.Controllers.HomeController

Solution:

In Global.asax

    routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional },
new string[] { "Project.Web.Controllers" }
);

No comments:

Post a Comment