I was trying to use Microsoft.ApplicationInsights, and I installed the same through nuget. but when I am trying to use
_telemetryClient.TrackException(ex, new Dictionary<string, string>
{
{"Id", id.ToString()}
}, null);
I am getting an error saying: InstrumentationKey cannot be empty.
I have already gone through the URL but I can't see any Update menu available for the config file in my VS(Note: I am using VS 2012 Pro).
I have also tried updating the config file with the instrumentation key
<ComponentID>{Instrumentation Key}</ComponentID>
But, that didn't work too.
Thanks.
Did you download nuget manually or did you get it via UI by adding AppInsights to the project? We have seen this issue when users try to add individual nugget manually.
The easiest way to recover is to add full AppInsights support by right click on the project and choosing Update Application Insights - it will ask you to create new AI resource or point to existing AI resource and it will create instrumentation key for you.
But you'd need to use VS 2013 in order to have VS integration for Application Insights.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With