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);
}
}