Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
386 views
in Technique[技术] by (71.8m points)

mvc mini profiler - MiniProfiler cannot find jquery

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...