【发布时间】:2017-08-17 13:38:29
【问题描述】:
当我厌倦了在没有页面隐藏代码的 SharePoint 布局 aspx 页面中引用“Microsoft.ApplicationInsights”时,我收到了以下错误。
在编译请求的文件或其依赖项之一期间发生错误。找不到类型或命名空间名称“TelemetryClient”(您是否缺少 using 指令或程序集引用?)
尝试了以下方法
<%@ Assembly Name="Microsoft.ApplicationInsights, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"%>
还有
<%@ Import Namespace="Microsoft.ApplicationInsights" %>
在我试图创建 TelemetryClient 对象以将数据记录到 Azure 的 aspx 页面中的一段内联 C# 代码下方
.....
TelemetryClient telemetryClient = new TelemetryClient();
telemetryClient.InstrumentationKey = instKey;
telemetryClient.TrackException(ex, sp_coid);
.....
【问题讨论】:
标签: c# azure sharepoint reference telemetry