I'm trying to get Application Insights to work with my WPF application, but whenever I try to call any of the Track functions, I get a nullreferenceexception with this stacktrace
at Microsoft.ApplicationInsights.TelemetryClient.Track(ITelemetry telemetry)
at Microsoft.ApplicationInsights.TelemetryClient.TrackTrace(TraceTelemetry telemetry)
at Microsoft.ApplicationInsights.TelemetryClient.TrackTrace(String message)
I added an application in Azure so that I got an instrumentationKey (hidden in the code below), added the nuget package and entered this code:
var config = new TelemetryConfiguration();
client = new TelemetryClient(config);
config.InstrumentationKey = "myKey";
client.InstrumentationKey = "myKey";
client.TrackTrace("testing testing");
client.Flush();
The crash occurs at the 5:th line above, and It occurs no matter which version of the nuget package I use.
I've heard some people mention an ApplicationInsights.config, but no such file has been generated for me.