You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
using System;
using System.Runtime.InteropServices;
namespace ConsoleApplication
{
public class Program
{
public delegate void Callback(int n);
[DllImport("Framework")]
public static extern void Run(Callback cb);
private static void Process(int num)
{
throw new System.ArgumentException("Invalid argument " + num);
}
public static void Main(string[] args)
{
Console.WriteLine("Before");
try
{
Run(Process);
}
catch (System.Exception ex)
{
Console.WriteLine("Caught");
Console.WriteLine(ex);
}
Console.WriteLine("After");
}
}
}
The exception is expected to be caught in Main, but it doesn't:
Before
Unhandled Exception: System.ArgumentException: Invalid argument 3
at ConsoleApplication.Program.Process(Int32 num)
at ConsoleApplication.Program.Run(Callback cb)
at ConsoleApplication.Program.Main(String[] args)
The text was updated successfully, but these errors were encountered:
In ARM/Linux, Core CLR failed to propagate exception through unmanaged-managed boundary.
As a result, Core CLR does not work as expected for the following code:
Framework.c
Program.cs
The exception is expected to be caught in Main, but it doesn't:
The text was updated successfully, but these errors were encountered: