Running MiniProfiler with runAllManagedModulesForAllRequests set to false

We recently upgraded the MiniProfiler version 2.0.1 from version v1.7, and since then we have not been able to use it on our MVC3 website, because when she tries to get her resources, she gets 404 instead.

Example of a resource call: /mini-profiler-resources/includes.js?v=tNlJPuyuHLy/d5LQjyDuRbWKa0weCpmO3xkO6MH4TtA =

When searching around, most people think that setting runAllManagedModulesForAllRequests should be set to true . For a giggle, I went ahead and found that it was true, and yes, it really worked. But this is not an acceptable answer.

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

+47
web-config asp.net-mvc-3 mvc-mini-profiler
Apr 24 '12 at 19:22
source share
3 answers

I had the same problem - the requested resources use "static" file extensions (for example, .js ), and therefore IIS wants to process them using its static file handler.

Fortunately, all MiniProfiler resources are requested using the mini-profiler-resources path, 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 IIS instruction above states that any request is for a mini-profiler-resources route that must be routed through ASP.NET.

+74
Apr 28 2018-12-12T00:
source share

As David Duffet says in the comments in the accepted answer, you may also need to add the following entry to your web configuration. This worked for me:

 <system.web> <httpHandlers> <add verb="*" type="System.Web.Routing.UrlRoutingModule" path="mini-profiler-resources/*"/> </httpHandlers> </system.web> 
0
Jun 24 '15 at 12:16
source share

I had a similar problem, and I decided to fix it by changing the application pool to "integrated", and then added this new line below to my web.config and then worked.

This is how the whole web.config for the mini profiler now looks.

 <system.webServer> <modules runAllManagedModulesForAllRequests="false" /> <validation validateIntegratedModeConfiguration="false"/> <!-- Here is the new line --> <handlers> <add name="MiniProfiler" verb="*" type="System.Web.Routing.UrlRoutingModule" path="mini-profiler-resources/*"/> </handlers> </system.webServer> 
0
Sep 16 '15 at 15:03
source share



All Articles