Topic | Value |
---|---|
Id | IDISP021 |
Severity | Warning |
Enabled | True |
Category | IDisposableAnalyzers.Correctness |
Code | DisposeMethodAnalyzer |
Call this.Dispose(true).
public class C : IDisposable
{
public void Dispose()
{
this.Dispose(false); // should be true here
}
protected virtual void Dispose(bool disposing)
{
...
}
}
Use the code fix.
Configure the severity per project, for more info see MSDN.
#pragma warning disable IDISP021 // Call this.Dispose(true)
Code violating the rule here
#pragma warning restore IDISP021 // Call this.Dispose(true)
Or put this at the top of the file to disable all instances.
#pragma warning disable IDISP021 // Call this.Dispose(true)
[System.Diagnostics.CodeAnalysis.SuppressMessage("IDisposableAnalyzers.Correctness",
"IDISP021:Call this.Dispose(true)",
Justification = "Reason...")]