I am having this error on my new asp.net app
Multiple types were found that match the controller named 'Home'. 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 'Home' has found the following matching controllers: Contoso.CAMPF.Sample1Web.Controllers.HomeController CAMPF.WebApp.Controllers.HomeController
The weird thing is that I dont event have a constoso namespace anywhere, I removed it, in the past I did, but I decided at some point to change assembly and namespaces names.
namespace CAMPF.WebApp.Controllers
{
public class HomeController : Controller
{
[SharePointContextFilter]
public ActionResult Index()
{
found the error, because I changed the namespace and assembly name, then on the bin folder the old dll was still there, so it looks like the mvc engine searches for controllers in the entire bin folder
I had the same issue. It turns out, the old .ddl files were still in the bin folder. After removing those, everything was fine. Basically when you had renamed the namespace, it effectively renamed the output assembly. Upon build, the new .ddls were created, but the old .ddls still existed.
Good luck, happy coding :))))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With