当我使用TelemetryConfiguration
示例来传递配置时,它会抛出一个声纳问题,如
'TelemetryConfiguration.TelemetryConfiguration(string)' is obsolete: 'InstrumentationKey based global ingestion is being deprecated. Use the default constructor and manually set TelemetryConfiguration.ConnectionString. See https://github.com/microsoft/ApplicationInsights-dotnet/issues/2560 for more details.' [SofyUtilCommon]csharp(CS0618)
我的代码:
public class AppInsightsService
{
public static string InstrumentationKey =>
AppSettings.ApplicationInsights.InstrumentationKey;
/// <summary>The TelemetryConfiguration for application</summary>
public static TelemetryConfiguration Configuration
{
get => configuration ??= new TelemetryConfiguration(InstrumentationKey);
set => configuration = value;
}
}
1条答案
按热度按时间qxgroojn1#
我尝试了下面的解决方案,它为我工作,也声纳没有显示任何错误。