I'm using Application Insights for a WPF Application. Tracking of PageViews and custom events is working.
Now I would like to track crashes. My idea was to:
private void AppDispatcherUnhandledException(object sender,
DispatcherUnhandledExceptionEventArgs e)
{
telemetryClient.TrackException(e.Exception);
telemetryClient.Flush();
}
The code is called when a unhandled exception occurs but it is not shown as "Crash" in the Application Insights portal. I have read somewhere that TrackException does not count as "Crash" when the application does not really crash.
Desktop (e.g. WPF) applications must use the low level API of Application Insights. I have not found a way to tell Application Insights that the WPF Application is crashing.
How could I do that?