Enabling the Insights app makes the web application freeze

After turning on Application Insights in my web project, it works fine for multiple requests, but then all requests freeze indefinitely. This is done locally using the Visual Studio debugger. With the help of a violinist, I see that requests are waiting for an answer that never comes. There are no errors. In the end, Visual Studio also freezes, and I need to kill it.

I am using Visual Studio 2013 4 update. I right-clicked on my web project and clicked the Add Insights Telemetry application button. Then I removed the Instrumentation key from ApplicationInsights.config, since I do not want telemetry for local development. The Instrumentation key will be installed in the settings of the Azure application for a live application.

If I go back without Application Insights, I will not hang.

Any ideas? Thanks!

+6
source share
3 answers

I ran 2.0.0-rc1 and had this problem. Commenting out this line of code in ApplicationInsights.config also fixed the problem.

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

Updating Application Insights to 2.0.0 also solved the problem for me. Thanks to Anastasia and Allen!

+1
source

[ EDIT ]

The previous fix seemed to work at first, but actually the trick was to comment on the PerformanceCollectorModule element from ApplicationInsights.config.

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

[ Old answer ]

Disabling telemetry, if there is no tool key, fixes the problem.

I expected this to be done under the hood, but it doesn't seem to be that way.

I put this code in the global.asax Application_Start method:

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

I do not want to steal any credit from another answer, but I wanted to dwell on my comment in detail. I reinstalled Visual Studio (with the long shots I know) and still had the problem. It seems that when the HTTP modules for AI are loaded into IIS Express, things go south quickly, so I only had to download these modules when launching the release configuration.

This means that you update your web.config to remove the AI โ€‹โ€‹instructions, and instead move them to Web.Release.config as a conversion so that they load when building the release configuration:

fooobar.com/questions/997597 / ...

Note, however, that the assemblies have changed since the response was sent. Here is what I need to add:

  <system.web> <compilation xdt:Transform="RemoveAttributes(debug)" /> <httpModules> <!-- Enable application insights when running in release mode (it don't work right locally...) --> <!-- /questions/997597/arearegistrationregisterallareas-never-finishes-when-using-application-insights/3424401#3424401 --> <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...) --> <!-- /questions/997597/arearegistrationregisterallareas-never-finishes-when-using-application-insights/3424401#3424401 --> <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> 
+1
source

All Articles