0
當我厭倦了在SharePoint佈局aspx頁面中引用「Microsoft.ApplicationInsights」時,出現以下錯誤,該頁面沒有頁面後面的代碼。如何在aspx頁面內聯編碼中添加程序集引用
在編譯請求的文件或其依賴項之一時發生錯誤。類型或命名空間名稱「TelemetryClient」找不到(是否缺少using指令或程序集引用?)
嘗試以下方法
<%@ Assembly Name="Microsoft.ApplicationInsights, Version=2.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"%>
也
<%@ Import Namespace="Microsoft.ApplicationInsights" %>
下面是aspx頁面中的一行內嵌C#代碼,其中我試圖創建TelemetryClient對象以將數據記錄到Azure中
.....
TelemetryClient telemetryClient = new TelemetryClient();
telemetryClient.InstrumentationKey = instKey;
telemetryClient.TrackException(ex, sp_coid);
.....
它會引用GAC在服務器上的權利?我將SharePoint wsp打包在本地並將其部署到服務器上。 – krishna