Stream.DisposeAsync() .NET Standard 2.0 [Answered]

Is there any way to dispose a stream asynchronously in .NET Standard 2.0? Would using await Task.Run(stream.Dispose); work?
3 Replies
jcotton42
jcotton422y ago
That's not really async You're just shunting the Dispose onto the thread pool And waiting asynchronously for that to finish Just use normal Dispose
MKP
MKP2y ago
Dispose should be called normally when you using a using clause
Accord
Accord2y ago
✅ This post has been marked as answered!