无法加载类型“Microsoft.ApplicationInsights.Telemetry.Web.ApplicationInsightsModule”

3
我有一个使用C#.Net开发的Azure服务。当我编译解决方案时,没有任何错误。
但是当我运行它时,会抛出以下错误:
“无法加载类型'Microsoft.ApplicationInsights.Telemetry.Web.ApplicationInsightsModule'”
以下是运行解决方案时指向的部分。
<system.web>
     <compilation debug="true" targetFramework="4.5" />
     <httpRuntime targetFramework="4.5" relaxedUrlToFileSystemMapping="true" />
     <customErrors mode="Off" defaultRedirect="/Error/Error.html" />
     <pages controlRenderingCompatibilityVersion="4.5" />
     <httpModules>
        <add name="ApplicationInsights" type="Microsoft.ApplicationInsights.Telemetry.Web.ApplicationInsightsModule" />
     </httpModules>
</system.web>
2个回答

3

请确保已安装Application Insights API的NuGet包

  1. 在Visual Studio解决方案资源管理器中打开您的项目的上下文菜单。
  2. 选择“管理NuGet包”。
  3. 查看在线软件包并搜索“Application Insights”。请包括引号。
  4. 选择“服务的Application Insights遥测SDK”。

2

我曾经遇到同样的问题。通过重新安装Microsoft.ApplicationInsights NuGet包进行修复。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接