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

Published on April 21, 2013 by Senthil Kumar

Filed under ASP.NET

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 10605 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.

Leave a Comment


You might be Interested in these Posts

How to read connection string from web.config in ASP.NET and C# ?

Here's a sample code snippet demonstrating how to get the connection string from your ASP.NET

How to return Json instead of XML in ASP.NET Web API ?

When you make a call to the ASP.NET Web API action method and notice this in Google Chrome browser ,...

How to Add Web API to existing ASP.NET Web Forms Project ?

In one of the previous posts , we saw how to add the WebAPI to the existing ASP.NET MVC project. Wel...