related:
Multiple types were found that match the controller named 'Home'
Multiple types were found that match the controller named 'Home' - In two different Areas
Multiple types were found that match the controller named 'FW'.
The request for 'FW' has found the following matching controllers:
app.Controllers.Admin.FWController
app.Areas.Manage.Controllers.FWController
I tried the suggestions from those related links. I attempted to differentiate the controllers by using different namespaces:
global.asax.cs
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}",
new { controller = "Account", action = "LogOn", id = UrlParameter.Optional },
new string[] { "app.Controllers" }
);
routes.MapRoute(
"Default_Admin_Top", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Account", action = "LogOn", id = UrlParameter.Optional },
new string[] { "app.Controllers.Admin" }
);
in the manage area ManageAreaRegistration
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute(
"Manage_default",
"Manage/{controller}/{action}/{id}",
new { action = "Index", id = UrlParameter.Optional },
new string[] { "app.Areas.Manage.Controllers" }
);
}
I also looked in the bin
folder for an old version but there was only the current one.
What am I missing? It seems like this should work.
The issue appears to revolve around the fact that I gave my controller its own namespace without it being in its own area:
namespace app.Controllers.Admin
{
public class FWController : Controller{}
}
Removing the .Admin
from the namespace here will remove the collision and also the error, but I do not fully understand why.