Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MVC-Mini-Profiler - Web Forms - 'MiniProfiler' is undefined

I tired to install the MiniProfiler, using the HowTo on http://miniprofiler.com/

This seems to work:

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

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

'MiniProfiler' is undefined

The problem is in the included MiniProfiler code:

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

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

I even tried this Solution found on stackoverflow but it did not work for me :(

Does anybody know this problem, or know what I can do to fix that?

SOLUTION

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

<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 get the handlers to work.

<modules runAllManagedModulesForAllRequests="true"/>
like image 857
Oliver Avatar asked Jul 16 '12 13:07

Oliver


1 Answers

You should be able to avoid this issue a bit more concisely (one handler line instead of three) by adding the following to your main web.config file:

<system.webServer>
  ...
  <handlers>
    <add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
  </handlers>
</system.webServer>
like image 89
Yaakov Ellis Avatar answered Nov 02 '22 23:11

Yaakov Ellis