2012-04-18 65 views
24

我一直在使用MiniProfiler來衡量網站的性能。當我從版本1.9升級到2.0時,它停止工作。我將命名空間從MvcMiniProfiler更改爲StackExchange.Profiling。但是,當我下載一個頁面,提琴手顯示有404錯誤以下請求:MiniProfiler無法找到jquery

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

這可以防止結果在頁面中呈現。

爲了讓1.9版本MiniProfiler的工作,我不得不在web.config文件中的以下條目(如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> 

我試圖讓MiniProfiler 2.0運行包含在配置文件中的那些文件以及排除它們的文件都無法使用。

這是在IIS Express中的我的開發機器上運行的。

我的應用程序是一個使用Forms安全性的WebForms應用程序。

我該如何解決這個問題?

+0

你可以試試github最新的版本嗎 – 2012-04-19 15:40:50

+1

我試過了,它來自GitHub的最新源代碼,但仍然有問題。 – epotter 2012-04-19 20:18:41

+0

當我嘗試瀏覽到http:// localhost:43947/local/mini-profiler-resources/results-index時,我在mini-profiler-resources目錄中的所有項目上都收到404錯誤。 (includes.js,list.js,list.css,jquery.tmpl.js和list.css) – epotter 2012-04-19 20:21:16

回答

26

它看起來這是一個常見的問題,只需添加這web.config中,它應該是罰款

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> 
+0

添加行,問題解決。 – 2013-01-23 23:31:38

0

嘗試通過在Windows \ Microsoft.NET目錄下相應的.NET Framework文件夾中運行aspnet_regiis -i來重新註冊ASP.NET。我有類似的問題,通過重新註冊ASP.NET處理程序解決。

我想我在安裝.NET Framework後在IIS中安裝靜態文件服務功能後出現此問題。

1

我最終不得不做的是在我的服務器上創建一個文件夾調用mini-profiler-resources,然後將所有文件從StackExchange.Profiling/UI複製到它。不知道爲什麼這個工程雖然。我猜測我錯過了一些服務器設置,因爲我只需要在生產系統上執行此操作。一切工作都很適合開發。

0

我不知道ASP.NET但Rails中我解決了它擦除tmp/miniprofiler文件。當我重新加載它的頁面的作品。

1

我,當我寫下面的,而不是

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

代碼

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

爲了解決這個問題,我不得不在默認應用從經典改變其綜合開工。

這解決了這個問題。

此外,因爲我使用MVC4,我不得不下載MiniProfiler的源代碼並使用MVC4庫進行編譯。