【发布时间】:2016-08-15 16:53:35
【问题描述】:
我刚刚在我的 MVC 应用程序中启用了 Application Insights,并注意到在本地调试时,我的 Azure Application Insight 中捕获了跟踪信息。
在调试模式下,我想阻止我的应用在我的 Azure Application Insight 中记录事件,但仍会在 Visual Studio 的“诊断工具”>“事件”窗口中显示事件和日志记录信息。
我尝试了以下方法,虽然这会阻止在我的 Azure AI 中捕获事件,但 Visual Studio 不再在事件窗口中显示调试信息。
protected void Application_Start()
{
#if DEBUG
TelemetryConfiguration.Active.DisableTelemetry = true;
#endif
}
我上网寻找答案无济于事。希望有人能帮忙。
【问题讨论】:
-
今天的正确做法是什么?
标签: c# azure visual-studio-2015 azure-application-insights