我已经在控制台应用程序上运行了Log4Net,并且希望日志事件转到Application。
我无法通过右键单击我的项目添加AI -它不显示为一个选项。
我已经通过NuGet安装了AI,并且能够创建遥测客户端,但是不知道在哪里添加检测键。
这教程说:
在代码中设置插装键:
TelemetryConfiguration.Active.InstrumentationKey = " your key ";或者在ApplicationInsights.config中(如果您安装了一个标准遥测包):
<InstrumentationKey>your key</InstrumentationKey>我没有一个ApplicationInsights.config文件,因为我不能添加AI到项目。如果我只是在实例化遥测客户端时添加密钥,这样会有效吗?
var telemetryClient = new TelemetryClient { InstrumentationKey = ConfigurationManager.AppSettings["applicationInsights"] };发布于 2017-07-04 09:37:13
你最后的建议可能会奏效。你也可以这样做:
TelemetryConfiguration.Active.InstrumentationKey = ConfigurationManager.AppSettings["applicationInsights"];https://stackoverflow.com/questions/44901793
复制相似问题