-
Notifications
You must be signed in to change notification settings - Fork 152
Closed
Labels
Description
Bug description
VSTHRD200 should (probably) not report a warning for DisposeAsyncCore method name as it is recommended here: https://docs.microsoft.com/en-us/dotnet/standard/garbage-collection/implementing-disposeasync#disposeasync-and-disposeasynccore
Repro steps
Code to reproduce the behavior.
/// <summary>
/// Frees managed resources used by the object.
/// </summary>
/// <returns>A <see cref="ValueTask">task</see> that represents the asynchronous dispose operation.</returns>
protected virtual async ValueTask DisposeAsyncCore() // <<<<<<< WARNING HERE
{
this.log.Debug("*");
lock (this.disposedValueLock)
{
if (this.disposedValue)
{
this.log.Debug("$<ALREADY_DISPOSED>");
return;
}
this.disposedValue = true;
}
// ...
this.log.Debug("$");
}
/// <inheritdoc/>
public async ValueTask DisposeAsync()
{
await this.DisposeAsyncCore().ConfigureAwait(false);
GC.SuppressFinalize(this);
}Expected behavior
No warning.
Actual behavior
A warning is emitted.
BEagle1984, vchirikov, cyungmann, alexrp, Eli-Black-Work and 1 more