Is there a way to set up a global error handler for a MAUI app? My app is currently running fine when I launch it from Visual Studio. However on all simulators if I try and start the app up from the shell's app icon, it starts up then quits (and on iOS I get a crash dump). I have no idea where this is happening at, so wanted to try and catch in a global handler.
I looked at builder.ConfigureMauiHandlers, but it appears to only work with controls. You can't use a type of UnhandledExceptionEventHandler, which is what I was thinking would be appropriate.
I also tried an AppDomain handler, but it doesn't not appear to work either:
AppDomain ad = AppDomain.CurrentDomain;
ad.UnhandledException += Ad_UnhandledException;
Is this possible? I've only found samples for WCF and they don't work.