Open NN--- opened 3 years ago
https://blog.stephencleary.com/2013/04/implicit-async-context-asynclocal.html
Similar code will compile targeting .NET 4.0 (with Microsoft.Bcl.Async); however, it will not work correctly (unless it happens to run on .NET 4.5) because the logical call context is not copied at the right time. In that situation, different parts of different async methods will end up sharing the same stack (and overwriting each other’s stack).
Maybe there is some hack we can do ?:)
https://docs.microsoft.com/en-us/dotnet/api/system.threading.asynclocal-1?view=net-5.0