24

I've been using the MiniProfiler to measure site performance. When I upgraded from version 1.9 to 2.0, it stopped working. I changed the namespace from MvcMiniProfiler to StackExchange.Profiling. But when I load a page, fiddler shows there is a 404 error for the following request:

GET /local/mini-profiler-resources/jquery.1.7.1.js?v=tNlJPuyuHLy/d5LQjyDuRbWKa0weCpmO3xkO6MH4TtA= HTTP/1.1

This prevents the results from being rendered in the page.

To get the 1.9 version of MiniProfiler to work, I had to have the following entries in the Web.Config file (as described in this post):

  <system.webServer>
    <handlers>
      <add name="UrlRoutingModule1" path="mini-profiler*.js" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
      <add name="UrlRoutingModule2" path="mini-profiler*.css" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
      <add name="UrlRoutingModule3" path="mini-profiler*.tmpl" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
    </handlers>
  </system.webServer>

I have tried to get MiniProfiler 2.0 to run with those included in the config file and with them excluded, neither way worked.

This is running on my development machine in IIS Express.

My app is a WebForms app that uses Forms security.

How do I resolve this?

Community
  • 1
  • 1
epotter
  • 7,631
  • 7
  • 63
  • 88
  • can you try with latest from github – Sam Saffron Apr 19 '12 at 15:40
  • 1
    I tried it with the latest source from GitHub and still got the issue. – epotter Apr 19 '12 at 20:18
  • When I try to browse to http://localhost:43947/local/mini-profiler-resources/results-index, I get 404 errors on all of the items in the mini-profiler-resources directory. (includes.js, list.js, list.css, jquery.tmpl.js, and list.css) – epotter Apr 19 '12 at 20:21
  • I don't know if it matters, but in the test project, the url to the resources is localhost:43947/mini-profiler-resources and the project where I have the problem, the url is localhost:43947/LOCAL/mini-profiler-resources. Does the additional "LOCAL" directory cause the issue? – epotter Apr 20 '12 at 13:32
  • 1
    I am having an issue too. What do you have set for `runAllManagedModulesForAllRequests` set to in the `modules` section of the `web.config`? I may have asked a related question to yours here: http://stackoverflow.com/q/10304611/498969 – Adam Spicer Apr 24 '12 at 19:22
  • Is your application pool running in Classic or Integrated managed pipeline mode? The handlers you specified will only work in integrated mode. – David Duffett Apr 28 '12 at 12:40
  • 4
    See the answer on my question: http://stackoverflow.com/q/10304611/498969. It fixed my issue! – Adam Spicer Apr 29 '12 at 22:17

5 Answers5

26

It looks like this is a common problem, just add this to the web.config and it should be fine

Running MiniProfiler with runAllManagedModulesForAllRequests set to false

<system.webServer>
...
  <handlers>
    <add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
  </handlers>
</system.webServer>
Community
  • 1
  • 1
Ben Anderson
  • 7,003
  • 4
  • 40
  • 40
1

What I ended up having to do was create a folder call mini-profiler-resources on my server and then copy all the files from StackExchange.Profiling/UI into it. Not sure why this works though. I am guessing I am missing some server setting, because I only had to do this on the production system. Everything worked fine out of the box for development.

tbs
  • 125
  • 2
  • 8
1

for me its start working when I write following code

 protected void Application_EndRequest()
        {
            MiniProfiler.Stop();
        }

instead of

 protected void Application_End(object sender, EventArgs e)
        {
            //  Code that runs on application shutdown
        MiniProfiler.Stop();
        }
0

Try re-registering ASP.NET by running aspnet_regiis -i from the appropriate .NET Framework folder under your Windows\Microsoft.NET directory. I've had similar issues that were solved by reregistering the ASP.NET handlers.

I think I had this issue after installing the Static File Serving functionality in IIS after installing the .NET Framework.

0

To Fix this i had to change the DefaultAppPool from Classic to Integrated.

This fixed the issue.

Also since i am using MVC4, i had to download the sources of MiniProfiler and compile them with the MVC4 libraries.

1st4ck
  • 1,267
  • 11
  • 11