5

我使用 Visual Studio 2013 Update 4 创建了一个新的 ASP.net MVC 应用程序并选中该框以使用 Application Insights。当我尝试运行应用程序(有或没有调试)时,站点永远不会加载。当我调试它时,我注意到它卡在 Global.asax.cs 中:

AreaRegistration.RegisterAllAreas();

我查看了其他几个问题的答案,包括这个: AreaRegistration.RegisterAllAreas() is not Registering Rules For Area

这并没有解决我的问题。我已经删除了这个答案中文件夹中的所有内容并重新启动了 Visual Studio,重新启动了我的电脑,无论我做什么,这个方法都会永远挂起。它似乎不只是慢,因为我已经等了超过 5 分钟,它还没有完成。有没有其他人遇到过这种情况,除了删除这个电话外,我该如何解决?

如果我注释掉 Application Insights 的 Http 模块注册,那么这个方法会立即完成,但是一旦我将它们添加回来,该方法就会再次挂起。AreaRegistration.RegisterAllAreas() 调用和 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>
4

2 回答 2

3

是的,我有同样的情况,我所做的是删除 appinsight 元素并在调试和发布 web.config 文件之间应用 xml 转换。当我想要调试并在发布时包含 appinsight 时,这对我很有帮助。

<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>
于 2015-01-13T13:32:36.647 回答
-1

您能否提供更多详细信息,以便我们重现此问题?

  • 您使用什么操作系统(Windows 版本)?
  • 您是在 IIS Express 还是常规 IIS 上运行创建的 Web 应用程序?

  • 如果这是常规 IIS,您使用什么应用程序池模式(集成/经典)?

  • 您选择哪个 .NET Framework 版本来创建应用程序?
  • 您的应用程序基于哪个 MVC 版本?
  • 您是否为您的 Web 应用项目启用了 WebAPI 或 WebForms?
于 2015-03-18T22:17:23.440 回答