ApplicationInsight causing website to hang at startup

你说的曾经没有我的故事 提交于 2019-12-08 17:30:12

问题


Is anyone using ApplicationInsight successfully at the moment?

I have had nothing but trouble trying to get it to work.

Firstly I had lots of problems with VS refusing to create a new website with ApplicationInsight and with adding ApplicationInsight to an existing website. The errors it gave where next to useless.

I finally managed to get a new website with AI working on my machine (after waiting 'some time', which was the official answer to the initial problem from Microsoft). However this website suddenly started hanging on startup with absolutely no error message or debug info that I could find.

I wasted over a day looking into DB connectivity issues as that is what I was working on when it started to hang before disabling AI and it started working again.

Is there any debug info available for AI so that if it happens again I can catch it?

All help and experience from others very much appreciated.

Cheers Mike

Added information:

I am running VS 2013 update 4.

All other software should be up to date.

Steps to reproduce:

  1. Start VS
  2. New Project
  3. MVC Project connected to ApplicationInsight

This should fail to run. It just hangs, waiting for localhost. If you add some breakpoints then it actually seems to hang in global.asax when it registers the areas.

    protected void Application_Start()
    {
        AreaRegistration.RegisterAllAreas();   <------------- hangs here
        FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
        RouteConfig.RegisterRoutes(RouteTable.Routes);
        BundleConfig.RegisterBundles(BundleTable.Bundles);
    }

Which doesn't make much sense as that line doesn't do anything in a clean MVC project.

If you disable AI in the web.config the project will work again.

<modules>
  <remove name="FormsAuthentication" />
  <remove name="ApplicationInsightsWebTracking" />
  <!--
    <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Extensibility.Web.RequestTracking.WebRequestTrackingModule, Microsoft.ApplicationInsights.Extensibility.Web" preCondition="managedHandler" />
  -->
</modules>

If someone else could try to replicate this that would be a great start.

Thanks.


回答1:


I've experienced this issue as well, but fortunately Sergey Kanzhelev from the AI team was able to help me work around it.

Remove (or comment out) the following line from ApplicationInsights.config:

<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCollector.PerformanceCollectorModule, Microsoft.ApplicationInsights.Extensibility.PerfCollector"/>

Note that this is a termporary workaround, but I'm sure they'll be fixing it soon.



来源:https://stackoverflow.com/questions/27874790/applicationinsight-causing-website-to-hang-at-startup

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