Topic | Value |
---|---|
Id | IDISP020 |
Severity | Warning |
Enabled | True |
Category | IDisposableAnalyzers.Correctness |
Code | DisposeMethodAnalyzer |
Call SuppressFinalize with this as argument.
public void Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(null);
}
public void Dispose()
{
this.Dispose(true);
GC.SuppressFinalize(this);
}
Configure the severity per project, for more info see MSDN.
#pragma warning disable IDISP020 // Call SuppressFinalize(this)
Code violating the rule here
#pragma warning restore IDISP020 // Call SuppressFinalize(this)
Or put this at the top of the file to disable all instances.
#pragma warning disable IDISP020 // Call SuppressFinalize(this)
[System.Diagnostics.CodeAnalysis.SuppressMessage("IDisposableAnalyzers.Correctness",
"IDISP020:Call SuppressFinalize(this)",
Justification = "Reason...")]