Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Namespace change - Multiple types were found that match the controller named 'Home'

I ran into the following problem after changing the namespace for my mvc project:

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:

oldns.Controllers.HomeController

newns.Controllers.HomeController

There are other answered questions about this error, but cover other causes:

  • Multiple projects
  • Areas
like image 547
Hypnovirus Avatar asked Jul 27 '12 14:07

Hypnovirus


1 Answers

After doing some research, I found that the cause was the old mvc app dll remaining in the bin folder (bin\oldns.dll). Clean was not clearing it out. I manually deleted the contents of the bin directory and then all was well.

like image 57
Hypnovirus Avatar answered Nov 06 '22 14:11

Hypnovirus