Async Await Recursion in .NET 4.8 causes StackoverflowException (not in .Net Core 3.1!)
问题 Why does the following code cause a StackOverflowException in .Net4.8 with only a 17-depth recursion? However this does not happen in NetCore 3.1 (I can set the count to 10_000 and it still works) class Program { static async Task Main(string[] args) { try { await TestAsync(17); } catch(Exception e) { Console.WriteLine("Exception caught: " + e); } } static async Task TestAsync(int count) { await Task.Run(() => { if (count <= 0) throw new Exception("ex"); }); Console.WriteLine(count); await