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.
Delete not only \bin files, but also \obj\debug and \release too.
Delete temporary ASP.NET files.
Check for any references to old DLL name in web.config.
Check all web.config files. Sometimes one is added to the Views folder too.
Solution 3:
Alternatively, you can follow these simple steps.
- Go to your Project Solution Explorer
- Right-click on Global.asax file
- Select "Open-with" option
- Select "Global.asax File Editor with Encoding"
- Click Ok and you can change the code to rectify the error yourself.
Try it! It worked for me.