I am trying to setup MiniProfiler to run in all of our environments instead of just on our local machines. It is my understanding that StackOverflow runs MiniProfiler in production without any issues. When I open my developer tools in Chrome and go to the network tab on StackOverflow's site, I do not see any posts being made to the following url:
mini-profiler-resources/results
When I look in the network tab on our site, I do see many posts to this URL. The code I am using in Global.cs is:
protected void Application_Start()
{
MiniProfiler.Settings.Results_Authorize = IsUserAllowedToSeeMiniProfilerUI;
MiniProfiler.Settings.Results_List_Authorize = IsUserAllowedToSeeMiniProfilerUI;
}
protected void Application_BeginRequest()
{
MiniProfiler.Start();
}
protected void Application_EndRequest()
{
MiniProfiler.Stop();
}
private static Boolean IsUserAllowedToSeeMiniProfilerUI(HttpRequest request)
{
return request.IsLocal || request.RequestContext.HttpContext.User.IsInRole("Admin");
}
Am I doing something wrong here? The only thing I can think of it not starting the profiling session, but then it wouldn't be profiling users requests. The MiniProfiler UI is not showing up, so that part is working correctly, however all of the requests are still being made and the RenderIncludes method is loading the js code into the DOM.
Thanks!