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 3199 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


You might be Interested in these Posts

How to read a connection string from web.config file in ASP.NET ?

Assume that you have a connectionstring configured in the web.config file of your ASP.NET applicatio...

Could not load file or assembly … An attempt was made to load a program with an incorrect format (System.BadImageFormatException)

There are times when you might get the following error when running the application from Visual Stud...

Building a ASP.NET Web API in Visual Studio 2015

This blog post will explain on how to create a Simple ASP.NET Web API using Microsoft Visual Studio ...