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