Q:

MiniProfiler does not load

I installed Nuget package miniprofiler.com but the profiler windows is not visible, but the miniprofiler script was generated to the html. 
I putted following script to the global.asax
        protected void Application_BeginRequest()
        {
            if (Request. IsLocal)
            {
                MiniProfiler. Start();
            }
        }

        protected void Application_EndRequest()
        {
            MiniProfiler. Stop();
        }

To the _Layout.cshtml at first line
@using StackExchange. Profiling; 

last lines
@MiniProfiler. RenderIncludes()
</body>
</html>

script generated
<script async type="text/javascript" id="mini-profiler" src="/mini-profiler-resources/includes.js?v=ySF6M98CBehTtL86BbiEmys9yxR1HKazhe2sznfdUWQ=" data-version="ySF6M98CBehTtL86BbiEmys9yxR1HKazhe2sznfdUWQ=" data-path="/mini-profiler-resources/" data-current-id="d011005d-606a-4dca-a3a0-8e8654c344af" data-ids="74098d83-5d5f-4f2b-a3ab-1a7294dd4490,f6e7117a-81cf-4632-b30b-9f93ec0ebfbf,b0069a2b-68b3-4e58-a477-5529e780266c,d011005d-606a-4dca-a3a0-8e8654c344af" data-position="left" data-trivial="false" data-children="false" data-max-traces="15" data-controls="false" data-authorized="true" data-toggle-shortcut="Alt+P" data-start-hidden="false" data-trivial-milliseconds="2"></script>

but I do not see the profiler window, what am I doing wrong ?! 
I also tried totally new web project (mvc4) in visual studio and the problem is same. 

A:

I tried the exact steps as yours and the profiler window was not getting displayed.  
I had to add a tag in the web.config file to get the profiler window to appear. 
Use runAllManagedModulesForAllRequests="true" as shown below,
<system.webServer>
   <modules runAllManagedModulesForAllRequests="true">

   </modules>
</system.webServer>

