I’m using MVC4 without WebAPI, just plain on MVC. I have an admin area (called “Admin”, as usual) which is properly registered:
public class AdminAreaRegistration : AreaRegistration
{
public override string AreaName { get { return "Admin"; } }
public override void RegisterArea(AreaRegistrationContext context)
{
context.MapRoute("EditGroupRoute", "admin/groups/{action}/{id}", new { controller = "EditGroup", action = "Index", id = UrlParameter.Optional });
//...
//No default handler at the end, all routes are predetermined
}
Global.asax:
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
//...
}
}
My regular, non-area RouteConfig.RegisterRoutes works as it should and contains normal routes with no default catch-all handler at the end.
Whenever I try some admin area route I get a 404 error. I’m using Haack’s RouteDebugger and it shows a full match (and only one match) below the 404 error text, with the correct area, controller and action.
I’ve checked similar questions on SO, but no joy. Any ideas what could be wrong?
Area controllers were in the wrong namespace. Originally they were in
/Controllerswhen I moved them to area controllers I didn’t update the namespaces.