The conventional Dispose
of a using
statement can be blocking. For example, this can happen if an output buffer was not flushed before disposal.
The .NET Standard 2.1 introduced the DisposeAsync
method as well as the IAsyncDisposable
interface for asynchronous disposal. Prefix the using
statement with await
to invoke the asynchronous version.