Suggestion - ASP.NET MVC Route Name Inspection

One feature which would be nice to see with ASP.NET MVC projects is error inspection on route names. It is produces a run time error to define two application routes with the same name, and this is certainly something ReSharper could determine before running the application with some code analysis. Particularly, support for inspection of both standard routes and area routes (MVC2) would be fantastic.

public static void RegisterRoutes(RouteCollection routes) {
    routes.MapRouteLowercase(
       "Default",
        "{controller}/{action}",
        new { controller = "Home", action = "Index" }
    );
}


public override void RegisterArea(AreaRegistrationContext context) {
    context.MapRouteLowercase(
       "Default",
        "admin/{controller}/{action}",
        new { controller = "Home", action = "Index" },

        new[] { "Web.Components.Controllers" }
    );
}

Please sign in to leave a comment.