-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Description
Description
I've been working on getting some integration tests working for Android in .NET 5/6, such as:
It appears that the AppDomain.CurrentDomain.UnhandledException event doesn't fire in an example such as:
public class MainActivity : Activity
{
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
SetContentView (Resource.Layout.Main);
AppDomain.CurrentDomain.UnhandledException += (sender, e) => {
Console.WriteLine ("# Unhandled Exception: sender={0}; e.IsTerminating={1}; e.ExceptionObject={2}",
sender, e.IsTerminating, e.ExceptionObject);
};
throw new Exception ("CRASH");
}
}AppDomain.CurrentDomain.UnhandledException seems to work fine in a .NET 5 console app:
https://docs.microsoft.com/dotnet/api/system.appdomain.unhandledexception?view=net-5.0
Configuration
I was using a master build of Xamarin.Android, but I tried these .NET versions:
- 5.0.100 GA
- 6.0.100-alpha.1.20555.3
Regression?
No, Android is a new platform.