Reputation: 380
I am working on an mvc app, and am getting multiple controller conflicts with my resolving a route. There is only one controller, and one dll in the site that has the controller. This is a big dll, and there are many controller in this one dll. Other MVC routes work fine. Why is this happening?
I'm aware that having 2 controllers with the same name should be namespaced. I'm aware that having a new and old dll will both load in the app and cause conflict, this is not the issue. - Multiple types were found that match the controller named 'Home'
The request for 'Nelson' has found the following matching controllers:
MyWebsite.Areas.Controllers.NelsonController
MyWebsite.Areas.Controllers.NelsonController
[InvalidOperationException: Multiple types were found that match the controller named 'Nelson'. This can happen if the route that services this request ('Nelson/NelsonGridView/{NelsonGVM}') 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 'Nelson' has found the following matching controllers:
MyWebsite.Areas.Controllers.NelsonController
MyWebsite.Areas.Controllers.NelsonController]
//the route
context.MapRoute(
"Nelson 603 Grid View",
"Nelson/NelsonGridView/{NelsonGVM}",
new { controller = this.AreaName, action = "NelsonGridView", NelsonGVM = new NelsonGVM() }
);
Sample url call:
https://mysite/CR/Nelson/NelsonGridView/
Upvotes: 0
Views: 50
Reputation: 6322
Only possibility is that somehow you may be ended up having duplicate dlls in bin folder. Do you by any chance renamed your project namespace? Because this will trigger VS.NET to produce new assembly and leave the old assembly in the bin folder side by side.
Please clean up the bin folder. Rebuild and try it.
Upvotes: 1