MiniProfiler cannot find jquery

╄→гoц情女王★ 提交于 2019-12-18 03:50:47

问题


I've been using the MiniProfiler to measure site performance. When I upgraded from version 1.9 to 2.0, it stopped working. I changed the namespace from MvcMiniProfiler to StackExchange.Profiling. But when I load a page, fiddler shows there is a 404 error for the following request:

GET /local/mini-profiler-resources/jquery.1.7.1.js?v=tNlJPuyuHLy/d5LQjyDuRbWKa0weCpmO3xkO6MH4TtA= HTTP/1.1

This prevents the results from being rendered in the page.

To get the 1.9 version of MiniProfiler to work, I had to have the following entries in the Web.Config file (as described in this post):

  <system.webServer>
    <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>

I have tried to get MiniProfiler 2.0 to run with those included in the config file and with them excluded, neither way worked.

This is running on my development machine in IIS Express.

My app is a WebForms app that uses Forms security.

How do I resolve this?


回答1:


It looks like this is a common problem, just add this to the web.config and it should be fine

Running MiniProfiler with runAllManagedModulesForAllRequests set to false

<system.webServer>
...
  <handlers>
    <add name="MiniProfiler" path="mini-profiler-resources/*" verb="*" type="System.Web.Routing.UrlRoutingModule" resourceType="Unspecified" preCondition="integratedMode" />
  </handlers>
</system.webServer>



回答2:


What I ended up having to do was create a folder call mini-profiler-resources on my server and then copy all the files from StackExchange.Profiling/UI into it. Not sure why this works though. I am guessing I am missing some server setting, because I only had to do this on the production system. Everything worked fine out of the box for development.




回答3:


for me its start working when I write following code

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

instead of

 protected void Application_End(object sender, EventArgs e)
        {
            //  Code that runs on application shutdown
        MiniProfiler.Stop();
        }



回答4:


Try re-registering ASP.NET by running aspnet_regiis -i from the appropriate .NET Framework folder under your Windows\Microsoft.NET directory. I've had similar issues that were solved by reregistering the ASP.NET handlers.

I think I had this issue after installing the Static File Serving functionality in IIS after installing the .NET Framework.




回答5:


I don't know about ASP.NET but in Rails I solved it erasing tmp/miniprofiler files. When I reloaded the page it works.




回答6:


To Fix this i had to change the DefaultAppPool from Classic to Integrated.

This fixed the issue.

Also since i am using MVC4, i had to download the sources of MiniProfiler and compile them with the MVC4 libraries.



来源:https://stackoverflow.com/questions/10212725/miniprofiler-cannot-find-jquery

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!