Jonas Arcangel
Jonas Arcangel

Reputation: 1925

Getting 'Multiple Controllers Found' Error

I am getting this runtime error from a new project.

I actually don't have any duplicate controller names. They all reside in my Controller folder and have unique names. I am not sure why I'm getting this.

I also did follow the suggestion to add a namespaces parameter even if they were all located in one folder.

Multiple types were found that match the controller named 'Channel'.

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 'Channel' has found the following matching controllers:

MyProject.Controllers.ChannelController

MyProject.Controllers.ChannelController

Upvotes: 1

Views: 197

Answers (1)

Jonas Arcangel
Jonas Arcangel

Reputation: 1925

It turns out I had another DLL in the same folder. I renamed my project, and the older DLL was there with exactly the same controllers.

Upvotes: 2

Related Questions