.NET Core: Finally block not called on unhandled exception on Linux
问题 I have created the following C# program: namespace dispose_test { class Program { static void Main(string[] args) { using (var disp = new MyDisposable()) { throw new Exception("Boom"); } } } public class MyDisposable : IDisposable { public void Dispose() { Console.WriteLine("Disposed"); } } } When I run this using dotnet run , I see the following behavior: Windows: Exception text written to console, "Disposed" printed ~20 second later, program exits. Linux: Exception text written to console,