Rename an ASP.NET MVC project by creating several types of controller errors

This happened before, and I can’t remember how I decided it. I renamed the MVC project and then ReSharper refactoring updated the namespaces. Now, when I start, I get the following error when starting the project:

Multiple types were found that match the controller named 'Dashboard'. 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 'Dashboard' has found the following matching controllers: EkmDomains.FrontEnd.Controllers.DashboardController EkmDomains.Web.Controllers.DashboardController 

I searched everywhere in the solution where the old EkmDomains.FrontEnd ocurrs namespace replaced it with a new one, but to no avail ...

Does anyone have any idea?

+47
c # asp.net-mvc-3
Jun 16 2018-11-11T00:
source share
3 answers

Haha, I just remembered how I did it last time - you need to manually delete the old dll from the bin folder. Performing a cleanup does not get rid of them, because a clean only deleting DLL that matches the project name - therefore, it leaves the DLL with the old project name.

+107
Jun 16 2018-11-11T00:
source share
β€” -

Adding a few more for anyone else. It cost me an hour of my life that I will not return.

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

  2. Delete temporary ASP.NET files.

  3. Check for links to the old DLL name in the web.config file.

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

0
Jan 24 '19 at 16:35
source share

In addition, you can follow these simple steps. 1. Go to the Project Solution explorer 2. Right-click the Global.asax file 3. Select "Open with option" 4. Select "Global.asax encoded file editor" 5. Click "OK" and you can change the code, to fix the error yourself. Try! It worked for me.

0
Jun 17 '19 at 13:14
source share



All Articles