5

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.

2
  • Did you rename a referenced project also? Commented May 28, 2013 at 7:59
  • yes, there are three projects in my solution and i renamed two Commented May 28, 2013 at 8:01

1 Answer 1

7

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.

Sign up to request clarification or add additional context in comments.

4 Comments

I still did that. I cant imagine where ASP.NET find the first route. There is no folder, file, reference or anything else with that name Jo***MVC
There must be such file left in your bin folder. There's no other explanation. Navigate with your Windows Explorer to the bin folder of your ASP.NET MVC application and delete ALL files. Then rebuild.
now it works, after the second delete all files and rebuild. oO Thank you :)
One would assume, that the cleanup option in the project's context menu would do this, but no, still had to delete the dlls manually...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.