Renaming Project or Solution , Multiple Classes Error

When renaming a project, ensure to empty the /bin/ folder within the project for a clean rebuild.

Old DLL’s from previous builds could cause failures in resolving Controller names as 2 or more instances of the same controller would be found under 2 diff namespaces.

Easiest way: Right click solution -> Clean Solution and then Rebuild.

Repro steps:

1. Create a ASP.NET Web Project with name – App1 and add a controller.

2. Rebuild this project.

3. Rename project to App2 and all namespaces within.

4. Rebuild this project App2.

5. When making a call to a controller method SomeMethod, the routing complains that it cant resolve the controller name due to 2 instances of the controller – one as App1.SomeMethod and another App2.SomeMethod.

— the end —

Leave a Reply

Your email address will not be published. Required fields are marked *