Skip to content

Latest commit

 

History

History
50 lines (36 loc) · 1.29 KB

IDISP019.md

File metadata and controls

50 lines (36 loc) · 1.29 KB

IDISP019

Call SuppressFinalize

Topic Value
Id IDISP019
Severity Warning
Enabled True
Category IDisposableAnalyzers.Correctness
Code DisposeMethodAnalyzer

Description

Call SuppressFinalize as there is a virtual dispose method.

Motivation

Call SuppressFinalize(this) as the type has a virtual dispose method.

How to fix violations

Use the code fix.

Configure severity

Via ruleset file.

Configure the severity per project, for more info see MSDN.

Via #pragma directive.

#pragma warning disable IDISP019 // Call SuppressFinalize
Code violating the rule here
#pragma warning restore IDISP019 // Call SuppressFinalize

Or put this at the top of the file to disable all instances.

#pragma warning disable IDISP019 // Call SuppressFinalize

Via attribute [SuppressMessage].

[System.Diagnostics.CodeAnalysis.SuppressMessage("IDisposableAnalyzers.Correctness", 
    "IDISP019:Call SuppressFinalize", 
    Justification = "Reason...")]