Rename ASP.NET MVC project resulting in multiple types for controller error

Solution 1:

Haha I just remembered how I did it last time - you have to manually delete the old dll's from the bin folder. Doing a clean doesn't get rid of them because a clean only delete's DLL's that match the project name - hence it leaves the DLL's with the old project name.

Solution 2:

Adding a few more for anyone else. These cost me an hour of my life that I'm not getting back.

  1. Delete not only \bin files, but also \obj\debug and \release too.

  2. Delete temporary ASP.NET files.

  3. Check for any references to old DLL name in web.config.

  4. Check all web.config files. Sometimes one is added to the Views folder too.

Solution 3:

Alternatively, you can follow these simple steps.

  1. Go to your Project Solution Explorer
  2. Right-click on Global.asax file
  3. Select "Open-with" option
  4. Select "Global.asax File Editor with Encoding"
  5. Click Ok and you can change the code to rectify the error yourself.

Try it! It worked for me.