使用应用程序时,洞察AreaRegistration.RegisterAllAreas()永远不会完成 [英] AreaRegistration.RegisterAllAreas() never finishes when using Application Insights

查看:150
本文介绍了使用应用程序时,洞察AreaRegistration.RegisterAllAreas()永远不会完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建使用Visual Studio 2013更新4新的ASP.net MVC应用程序,并检查使用应用程序的见解框。当我尝试(带或不带调试)运行应用程序的网站永远不会加载。当我调试它,我注意到它是被陷在Global.asax.cs中就行了:

  AreaRegistration.RegisterAllAreas();

我已经采取了看答案的几个其他问题包括这一个:
<一href=\"http://stackoverflow.com/questions/18313571/arearegistration-registerallareas-is-not-registering-rules-for-area\">AreaRegistration.RegisterAllAreas()未注册规则区

这并没有解决我的问题。我已删除所有在此答案文件夹中的内容并重新启动的Visual Studio,重新启动我的电脑也不管我做什么,这种方法只是挂起,直到永远。它似乎并不仅仅是缓慢的,因为我已经等了5分多钟,它仍然没有完成。有没有其他人遇到这种情况,我该如何解决这个问题比其他删除此电话吗?

如果我注释掉HTTP模块登记申请见解看起来那么这种方法完成​​向右走,但只要我添加他们回来的方法再次挂起。似乎有一些问题与AreaRegistration.RegisterAllAreas()调用和应用见解。

 &LT;&的HttpModules GT;
    &LT;! - 除去这使得一切工作 - &GT;
    &LT;! - &LT;添加名称=ApplicationInsightsWebTrackingTYPE =Microsoft.ApplicationInsights.Extensibility.Web.RequestTracking.WebRequestTrackingModule,Microsoft.ApplicationInsights.Extensibility.Web/&GT; - &GT;
&LT; /&的HttpModules GT;&LT;模块&gt;
  &LT;清除NAME =FormsAuthentication/&GT;
  &LT;! - 消除这些使事情的工作 - &GT;
  &LT;! -
  &LT;清除NAME =ApplicationInsightsWebTracking/&GT;
  &LT;添加名称=ApplicationInsightsWebTrackingTYPE =Microsoft.ApplicationInsights.Extensibility.Web.RequestTracking.WebRequestTrackingModule,Microsoft.ApplicationInsights.Extensibility.WebpreCondition =managedHandler/&GT;
   - &GT;
&LT; /模块&gt;


解决方案

是的,我有相同的情况,我所做的是删除appinsight元素和应用调试的XML转换和发布web.config文件。这可以帮助我,当我想调试和appinsight包括时发布。

 &LT;&的System.Web GT;
    &LT;编译XDT:转换=RemoveAttributes(调试)/&GT;
    &LT;&的HttpModules GT;
      &LT;添加名称=ApplicationInsightsWebTrackingTYPE =Microsoft.ApplicationInsights.Extensibility.Web.RequestTracking.WebRequestTrackingModule,Microsoft.ApplicationInsights.Extensibility.Web
           XDT:转换=插入/&GT;
    &LT; /&的HttpModules GT;  &LT; /system.web>  &LT; system.webServer&GT;
    &LT;模块&gt;
      &LT;清除NAME =ApplicationInsightsWebTrackingXDT:转换=插入/&GT;
      &LT;添加名称=ApplicationInsightsWebTrackingTYPE =Microsoft.ApplicationInsights.Extensibility.Web.RequestTracking.WebRequestTrackingModule,Microsoft.ApplicationInsights.Extensibility.WebpreCondition =managedHandlerXDT:转换=插入/&GT;
    &LT; /模块&gt;
&LT; /system.webServer>

I created a new ASP.net MVC application using Visual Studio 2013 Update 4 and checked the box to use Application Insights. When I try and run the application (with or without debugging) the site never loads. When I debug it I noticed that it is getting stuck in Global.asax.cs on the line:

AreaRegistration.RegisterAllAreas();

I have taken a look at the answers on a few other questions including this one: AreaRegistration.RegisterAllAreas() is not Registering Rules For Area

This did not solve my issue. I have deleted all of the content in the folders in this answer and restarted visual studio, restarted my PC and no matter what I do this method just hangs forever. It doesn't appear to just be slow, because I have waited for over 5 minutes and it still hasn't finished. Has anyone else run into this scenario and how can I fix it other than removing this call?

It appears if I comment out the Http Module registration for Application Insights then this method finishes right away, but as soon as I add them back the method hangs again. There appears to be some problem with the AreaRegistration.RegisterAllAreas() call and Application Insights.

<httpModules>
    <!-- removing this makes everything work -->
    <!-- <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Extensibility.Web.RequestTracking.WebRequestTrackingModule, Microsoft.ApplicationInsights.Extensibility.Web" /> -->
</httpModules>

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

解决方案

Yes i have the same situation and what i have done is remove appinsight element and apply xml transformation between debug and release web.config file. This helps me when me want to debug and include appinsight when release.

<system.web>
    <compilation xdt:Transform="RemoveAttributes(debug)" />
    <httpModules>
      <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Extensibility.Web.RequestTracking.WebRequestTrackingModule, Microsoft.ApplicationInsights.Extensibility.Web"
           xdt:Transform="Insert"/>
    </httpModules>

  </system.web>

  <system.webServer>
    <modules>
      <remove name="ApplicationInsightsWebTracking" xdt:Transform="Insert"/>
      <add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Extensibility.Web.RequestTracking.WebRequestTrackingModule, Microsoft.ApplicationInsights.Extensibility.Web" preCondition="managedHandler" xdt:Transform="Insert" />
    </modules>
</system.webServer>

这篇关于使用应用程序时,洞察AreaRegistration.RegisterAllAreas()永远不会完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆