Jörg Zeyn
Jörg Zeyn

Reputation: 81

Two routes after namespace refactoring MVC WebAPI

i renamed my namespace for my whole project. Everything is still working fine, but my WebAPI is now finding two routes for my controllers.

Multiple types were found that match the controller named 'department'.
This can happen if the route that services this request ('api/{controller}/{id}') found multiple controllers defined with the same name but differing namespaces, which is not supported.

The request for 'department' has found the following matching controllers:
A***.P***.Benutzerverwaltung.Jo***MVC.Controllers.DepartmentController
A***.Benutzerverwaltung.API.Controllers.DepartmentController

So i renamed the first namespace into the second, i searched everywhere for the old namespace, but nothing was found. So, what could i do?

Thanks for help.

Upvotes: 5

Views: 1661

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1038710

So, what could i do?

Go to the bin folder of your web application and delete the old assemblies. ASP.NET loads all assemblies that are present in the bin folder. So if you are saying that you renamed some class library project reference, the old assembly is still physically there.

Upvotes: 7

Related Questions