UWP Application Insights does not contain a call stack for failures

I have an Application Insights setup for a new UWP project.

I get all the information and crashes correctly, however, when I try to view the details of the exception, I get all the information, but:

  • Stack stack not available
  • Bad Method: Unknown

I include this in the App.xaml.cs constructor:

WindowsAppInitializer.InitializeAsync();
+4
source share
1 answer

If you can handle this exception yourself, you can add a stack trace (and everything else) as custom properties. In our application, we use the global exception handler initialized in the App constructor:

CoreApplication.UnhandledErrorDetected += UnhandledError;

:

private void UnhandledError(object sender, UnhandledErrorDetectedEventArgs eventArgs)
{
    try
    {
        eventArgs.UnhandledError.Propagate();
    }
    catch (Exception e)
    {
        var properties = new Dictionary<string, string>()
            {
                { "trace", e.StackTrace },
                { "mesage", e.Message },
            };

        telemetryClient.TrackCrash(e, properties);
    }
}
0

Source: https://habr.com/ru/post/1617054/


All Articles