I would like to catch unhandled exceptions in my MAUI project (for Windows and Android).
For this, I tried the following events:
AppDomain.CurrentDomain.UnhandledExceptions += ...
Dispatcher.UnhandledExceptions += ...
Application.Current.DispatcherUnhandledException += ...
TaskScheduler.UnobservedTaskException += ...
Unfortunately, all of this are not implemented or will not be triggered by this code:
throw new Exception();
My project file contains this:
<PropertyGroup>
<TargetFrameworks>net8.0-windows10.0.19041.0;net8.0-android34.0</TargetFrameworks>
How can I catch unhandled exceptions in a MAUI project?
(A solution to catch unhandled exceptions in tasks would be nice too, but I believe this is not possible.)