I am using MiniProfiler for an asp.net web api site that has an mvc aspect for its help pages.
I am attempting to profile one of the api methods, which is successful on my local machine, but when I deploy to my test server (win2008r2 / IIS 7.5), I am able to browse to /mini-profiler-resources/results
, but the page is blank because I am getting a 404 on includes.js
I've been reviewing the answers here which talk about adding entries to <system.webServer><handlers>
, and/or adding <system.webServer><modules runAllManagedModulesForAllRequests="true"/>
, none of which are successful in my case.
Here's the relevant code in my global.asax. I'm not sure if MiniProfilerHandler.RegisterRoutes()
is necessary:
protected void Application_Start()
{
AreaRegistration.RegisterAllAreas();
AutofacConfig.Register(GlobalConfiguration.Configuration);
WebApiConfig.Register(GlobalConfiguration.Configuration);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);
FluentValidationConfig.RegisterForWebApi(GlobalConfiguration.Configuration);
MiniProfilerHandler.RegisterRoutes();
MiniProfilerEF6.Initialize();
Database.SetInitializer<OasisIntegrationEntities>(null);
// UseMiniProfilerUi(object) returns true.
MiniProfiler.Settings.Results_Authorize = UseMiniProfilerUi;
MiniProfiler.Settings.Results_List_Authorize = UseMiniProfilerUi;
}
Is miniprofiler just not meant to run on the server, or am I missing something?
Adding the following to web.config ("handlers" section) did the trick for me:
<add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
Also, try to install https://www.nuget.org/packages/MiniProfiler.Mvc4/.
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