Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 340
Jörg Zeyn Avatar asked May 28 '13 07:05

Jörg Zeyn


1 Answers

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.

like image 162
Darin Dimitrov Avatar answered Sep 24 '22 16:09

Darin Dimitrov