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

Categories

Recently we upgraded to MiniProfiler version 2.0.1 from v1.7, and since then we have not been able to use it in our MVC3 website because when it tries to get its resources, it instead gets a 404.

An example resource call is: /mini-profiler-resources/includes.js?v=tNlJPuyuHLy/d5LQjyDuRbWKa0weCpmO3xkO6MH4TtA=

In searching around, most people are suggesting that simply setting runAllManagedModulesForAllRequests should be set to true. For giggles, I went ahead and set it to true, and yes it did work. But that is not an acceptable answer.

How can I keep runAllManagedModulesForAllRequests=false and still use MiniProfiler v2?

See Question&Answers more detail:os

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

1 Answer

I had the same issue - the resources being requested use "static" file extensions (such as .js) and therefore IIS wants to handle them using its static file handler.

Luckily all of the MiniProfiler resources are requested with the path mini-profiler-resources, so you can add the following to your web.config:

<system.webServer>
  ...
  <handlers>
    <add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
  </handlers>
</system.webServer>

The entry above instructs IIS that any request for the mini-profiler-resources path to be routed through ASP.NET.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...