简体   繁体   中英

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. I managed to see custom events in the search bar in the Azure portal, great.

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

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?

You likely need to add the ApplicationInsights.config file to your project.

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

在此处输入图片说明

Also, make sure you at least have the <ApplicationInsights ... root tag in your config file. Something like this:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM