Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

uwp app (.net native) and unhandled exception

I created uwp app(.Net native) for Windows 10 desktop. I use HockeyApp for collect live crash reports. Stack trace not informative. This is a long-standing problem and it does not have a solution. I tried this but it not working. I get these exceptions:

System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw
Arg_NullReferenceException

Microsoft.HockeyApp.Extensibility.Windows.UnhandledExceptionTelemetryModule.CoreApplication_UnhandledErrorDetected
 The parameter is incorrect. The parameter is incorrect.

On my computer the application works stably. Perhaps this is due to the versions of Windows. also I think that this is due to my xaml. It is very important for me to correct these mistakes. But I can not refuse the table. Any ideas how can I find the source of these errors?

like image 662
FetFrumos Avatar asked Dec 24 '22 11:12

FetFrumos


1 Answers

Sorry, this may not be an answer but I don't have enough room in the comments box.


Try the following in your App.xaml.cs. Add a handler to these events and see if they report something back to you about crashes.

public App()
{
    UnhandledException += OnUnhandledException;
    TaskScheduler.UnobservedTaskException += OnUnobservedException;

    InitializeComponent();
}

private static void OnUnhandledException(object sender, UnhandledExceptionEventArgs e)
{
    // Occurs when an exception is not handled on the UI thread.


    // if you want to suppress and handle it manually, 
    // otherwise app shuts down.
    e.Handled = true; 
}

private static void OnUnobservedException(object sender, UnobservedTaskExceptionEventArgs e)
{
    // Occurs when an exception is not handled on a background thread.
    // ie. A task is fired and forgotten Task.Run(() => {...})


    // suppress and handle it manually.
    e.SetObserved();
}
like image 57
Laith Avatar answered Dec 26 '22 01:12

Laith