Running MiniProfiler with runAllManagedModulesForAllRequests set to false

前端 未结 3 575
天命终不由人
天命终不由人 2020-12-12 23:57

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,

相关标签:
3条回答
  • 2020-12-13 00:36

    I had a similar issue and what I did to fix it was change the application pool to 'integrated' and then I added this new line below to my web.config and it then worked.

    Here is what the complete web.config looks like now for mini-profiler.

    <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 讨论(0)
  • 2020-12-13 00:44

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

    <system.web>
        <httpHandlers>
          <add verb="*" type="System.Web.Routing.UrlRoutingModule" path="mini-profiler-resources/*"/>
        </httpHandlers>
    </system.web>
    
    0 讨论(0)
  • 2020-12-13 00:47

    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.

    0 讨论(0)
提交回复
热议问题