MVC-Mini-Profiler - Web Forms - "MiniProfiler" - undefined

I'm tired of installing MiniProfiler using HowTo at http://miniprofiler.com/

It works:

<%= StackExchange.Profiling.MiniProfiler.RenderIncludes() %> 

But when I start the site, I get this error message:

 'MiniProfiler' is undefined 

The problem is the included MiniProfiler code:

  var initMp = function(){ load('/mini-profiler-resources/includes.js?v=6cJT7lsVkH6SxAlFpQstk1/AgtUwMUApXN3pviVvaRE=',function(){ MiniProfiler.init({..... 

When I try to open http://localhost/mini-profiler-resources/includes.js?v=6cJT7lsVkH6SxAlFpQstk1/AgtUwMUApXN3pviVvaRE= with IE, I get 404.

I even tried this solution https://stackoverflow.com/a/4646251/2126321 , but it did not work for me :(

Does anyone know this problem or know what I can do to fix this?

Decision

I solved the problem by adding the configuration section from this solution and the line "runAllManagedModulesForAllRequests":

 <system.webServer> <modules runAllManagedModulesForAllRequests="true"/> <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> 

The "trick" was to add the line below to make the handlers work.

 <modules runAllManagedModulesForAllRequests="true"/> 
+6
source share
1 answer

You should be able to avoid this problem a little more concisely (one line of the handler instead of three) by adding the following to your main 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> 
+3
source

Source: https://habr.com/ru/post/920589/


All Articles