The following code results in unhandled exception when compiled with NativeAOT:
class Program
{
static void Main(string[] args)
{
try
{
throw new Exception("boo");
}
catch (Exception ex2)
{
Console.WriteLine($"1: {ex2}");
try
{
throw;
//throw new ArgumentException("aE");
}
catch (Exception ex3)
{
Console.WriteLine($"2: {ex3}");
}
}
}
}
When the throw; is commented out and the throw new ArgumentException("aE"); is uncommented it works. So it is a rethrow only issue.