简体   繁体   English

Visual Studio Application Insights工具栏不显示事件

[英]Visual Studio Application Insights toolbar not showing events

I'm new to Application Insights and testing the concept of sending custom data in a console application. 我是Application Insights的新手,我正在测试在控制台应用程序中发送自定义数据的概念。 I managed to see custom events in the search bar in the Azure portal, great. 我设法在Azure门户的搜索栏中看到自定义事件,很好。

My problem is in some of the tutorials I went through, there's a toolbar in Visual Studio that shows the number of events eg Application Insights (21) but mine just has Application Insights without a number next to it and clicking on it shows 0 events 我的问题是在经历的一些教程中,Visual Studio中有一个工具栏,它显示事件数,例如Application Insights(21),但是我的工具栏旁边只有Application Insights,但没有数字,单击它显示0个事件

My code is uber-simple: 我的代码非常简单:

static void Main(string[] args)
{
    TelemetryConfiguration.Active.InstrumentationKey = "APPLICATIONINSIGHTS_GUID";

    TelemetryClient TC = new TelemetryClient();
    TC.TrackEvent("My event");
    TC.Flush();
}

I'm got Visual Studio 2015. Should I install something to make this work? 我有Visual Studio2015。是否应该安装一些东西才能使其正常工作?

You likely need to add the ApplicationInsights.config file to your project. 您可能需要将ApplicationInsights.config文件添加到项目中。

Make sure Build Action is Content and Output Directory is Copy if newer / Copy always so that it copies file to output directory on build Copy if newer请确保“构建操作”为“ Content ,“输出目录”为“ Copy if newer / Copy always以便在构建时将文件复制到输出目录

在此处输入图片说明

Also, make sure you at least have the <ApplicationInsights ... root tag in your config file. 另外,请确保您的配置文件中至少具有<ApplicationInsights ...根标记。 Something like this: 像这样:

    <?xml version="1.0" encoding="utf-8"?>
    <ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings">
    </ApplicationInsights>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何防止 Visual Studio 显示应用程序洞察提醒? - How to I prevent Visual Studio from showing application insights reminder? Visual Studio 2015 Debug输出显示“Application Insights遥测:{”name“:”Microsoft.ApplicationInsights.XXX.RemoteDependency“ - Visual Studio 2015 Debug output showing “Application Insights Telemetry: {”name“:”Microsoft.ApplicationInsights.XXX.RemoteDependency" Visual Studio中类库的Application Insights - Application Insights for class library in visual studio 如何在不使用Azure的情况下在控制台应用程序的Visual Studio 2015的诊断工具窗口中查看SQL事件(应用程序见解)? - How can I see SQL events (Application Insights) in the Diagnostic Tools window of Visual Studio 2015 in Console Application without using Azure? 如何在 Visual Studio MVC 项目中使用 application Insights REST API - How to Use application Insights REST API in Visual Studio MVC project Application Insights 不记录自定义事件 - Application Insights not logging custom events 工具栏在Visual Studio中消失了 - Toolbar disappeared in Visual Studio 如何使用Visual Studio工具栏在命令提示窗口上运行控制台应用程序 - How to run console application on command prompt window with visual studio Toolbar Azure Application Insights 跟踪未显示 - Azure Application Insights traces not showing Visual Studio 2010显示来自代码的可用事件 - Visual studio 2010 showing available events from code behind
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM