2015-11-22 60 views
6

在我的Web項目上啓用應用程序見解後,它可以對多個請求運行正常,但所有請求都會無限掛起。這是使用Visual Studio調試器在本地運行的。使用小提琴手,我可以看到一個請求正在等待一個永遠不會到來的響應。沒有錯誤。最終Visual Studio也掛起,我需要殺死它。啓用應用程序洞察會使Web應用程序掛起

我正在使用Visual Studio 2013更新4. 我沒有右鍵單擊我的Web項目,然後單擊添加Application Insights遙測。 接下來我從ApplicationInsights.config中刪除了Instrumentation Key,因爲我不想爲本地開發提供遙測。儀器密鑰將在實時應用程序的Azure應用程序設置中設置。

如果我在沒有Application Insights的情況下恢復原狀,則不會掛起。

任何想法? 謝謝!

回答

1

我正在運行2.0.0-rc1並出現此問題。在ApplicationInsights.config中註釋這行代碼也解決了這個問題。

<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.PerformanceCollectorModule, Microsoft.AI.PerfCounterCollector"> 

將Application Insights升級到2.0.0也解決了我的問題。謝謝阿納斯塔西婭&艾倫!

3

[編輯]

以前的修復工作一開始工作,但真正做的關鍵是要註釋掉ApplicationInsights.config的PerformanceCollectorModule。

<TelemetryModules> 
    ... 
    <!-- 
    <Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.PerformanceCollectorModule, Microsoft.AI.PerfCounterCollector"> 
    --> 
    ... 
</TelemetryModules> 

[老答案]

如果沒有提供儀器的關鍵不解決這個問題禁用遙測。

我有點期待這是在引擎蓋下完成的,但似乎沒有。

我把這個代碼在Global.asax中的Application_Start方法:

if (string.IsNullOrEmpty(WebConfigurationManager.AppSettings["APPINSIGHTS_INSTRUMENTATIONKEY"])) 
{ 
    Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration.Active.DisableTelemetry = true; 
} 
+0

我得到相同的行爲,但此修復程序不適用於我。我可以在Visual Studio中提供幾個請求,然後整個應用程序掛起。我無法停止調試或任何事情。想想我現在只是會推出應用程序洞察。 –

+0

查看我編輯的真正修復:-) –

1

我不想從另一個答案竊取任何信貸,但我想闡述一下我的意見。我重新安裝了Visual Studio(我知道的很長時間)並且仍然存在問題。看起來,當用於AI的HTTP模塊加載到IIS Express時,事情往往會南下,所以我不得不求助於在運行發行版配置時加載這些模塊。

這意味着更新你的web.config刪除AI的語句,而是將它們移動到Web.Release.config的轉變,所以當釋放的結構是建立他們裝:

https://stackoverflow.com/a/27923364/571237

但請注意,自答案發布以來,程序集已發生變化。以下是我需要添加的內容:

<system.web> 
    <compilation xdt:Transform="RemoveAttributes(debug)" /> 
    <httpModules> 
     <!-- Enable application insights when running in release mode (it don't work right locally...) --> 
     <!-- https://stackoverflow.com/a/27923364/571237 --> 
     <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" 
      xdt:Transform="Insert"/> 
    </httpModules> 
    </system.web> 

    <system.webServer> 
    <modules> 
     <!-- Enable application insights when running in release mode (it don't work right locally...) --> 
     <!-- https://stackoverflow.com/a/27923364/571237 --> 
     <remove name="ApplicationInsightsWebTracking" xdt:Transform="Insert"/> 
     <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" preCondition="managedHandler" xdt:Transform="Insert" /> 
    </modules> 
    </system.webServer> 
+3

AI對每個計數器模塊和IIS Express都有問題。 PerfCounters模塊正在嘗試讀取計數器,並且在IIS表達式的情況下,它實際上會對整個註冊表進行鎖定,如果其他模塊在同一時間加載(延遲被添加,但並非全部),則會導致死鎖。您可以嘗試刪除PerfCounters收集模塊,看看是否有幫助。 –

+0

@AnastasiaBaranchenkova謝謝你的解釋!我們刪除了該模塊,我們將看看是否有幫助。我們會回覆,謝謝! –

+0

在本週發佈的2.0.0版本中,當您使用iisexpress時,模塊會自動禁用。所以如果你更新你不應該再有這個問題了。 –