5
votes

How to fix ?

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: MyProject1.Controllers.HomeController MyProject2.Controllers.HomeController

3
Are you separating them by Area? - Daniel A. White

3 Answers

15
votes

Probably need a little bit more details. For e.g. Did you change the namespace from MyProject1 to MyProject2?

Check your bin folder to see if any of dlls from the old namespace are still around. If that's the case cleaning them up and recompiling should fix the issue.

2
votes

Make sure you edit the default namespace setting in your web project properties, on the Application tab.

1
votes

I assume this is in your Views. Be certain the namespaces in your views is correct.