5

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?

FetFrumos
  • 5,388
  • 8
  • 60
  • 98

1 Answers1

13

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();
}
Laith
  • 6,071
  • 1
  • 33
  • 60
  • `e.Handled = true;` has no bearing on the program terminating for me. Any idea what could be the cause for this? – Beltway Jan 28 '22 at 12:11