internal static void RegisterRoutes() { var urls = new[] { "ssr-jquip.all", "ssr-includes.js", "ssr-includes.css", "ssr-includes.tmpl", "ssr-results" }; var routes = RouteTable.Routes; var handler = new MiniProfilerRouteHandler(new MiniProfilerHandler()); var prefix = (Profiler.Settings.RouteBasePath ?? "").Replace("~/", "").WithTrailingSlash(); using (routes.GetWriteLock()) { foreach (var url in urls) { var route = new Route(prefix + url, handler) { // we have to specify these, so no MVC route helpers will match, e.g. @Html.ActionLink("Home", "Index", "Home") Defaults = new RouteValueDictionary(new { controller = "MiniProfilerHandler", action = "ProcessRequest" }) }; // put our routes at the beginning, like a boss routes.Insert(0, route); } } }