Multiple types were found that match the controller Error in ASP.NET MVC

Published on April 21, 2013 by AbundantCode

Filed under ASP.NET MVC

Last modified April 21, 2013

Print this page

rate 1 star rate 2 star rate 3 star rate 4 star rate 5 star
Your rating: none, Average: 0 (0 votes)

This article have been viewed 1320 times

There are times when you get the error similar to the below message when you type the URL

“Multiple types were found that match the controller named ‘Employee’. This can happen if the route that services this request (‘Abundantcode/{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 ‘Employee’ has found the following matching controllers:



Multiple types were found that match the controller Error in ASP.NET MVC

If the above error message is observed, it clearly states that the reason for the error is the Multiple Controller Name and Action Method defined in different Namespaces.

One way to resolve this error is to make sure that the controller name is unique. The other simple option is to specify the preference of the Namespace to be used in the MapRoute method of the RouteConfig file.

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Leave a Comment