ASP.NET MVC Namespace renaming

You need to check your /bin folder in your MVC Web project, and either delete everything inside there and do a new build, or delete the old DLL (MyProjectName.dll).

The ASP.Net MVC runtime uses reflection to determine which controller a request must be passed to based on the routing information, and it is finding two Controllers that match the criteria (have the same name), and each is in a different assembly. That is why you get the exception.

Doing a Clean doesn't seem to clear out the bin folder. So you have to delete the file manually.


Have you tried to rebuild (right click on project, and select "Rebuild")? Also check the bin to make sure only the assembly with the new name is there. Also, double check the project properties to verify the name of the assembly is outputted. If you're not sure what the name of the outputted assembly is, delete all the dlls from bin and rebuild.