Skip to content

Latest commit

 

History

History
51 lines (36 loc) · 1.41 KB

IDISP025.md

File metadata and controls

51 lines (36 loc) · 1.41 KB

IDISP025

Class with no virtual dispose method should be sealed

Topic Value
Id IDISP025
Severity Warning
Enabled True
Category IDisposableAnalyzers.Correctness
Code ClassDeclarationAnalyzer

Description

Class with no virtual dispose method should be sealed.

Motivation

ADD MOTIVATION HERE

How to fix violations

ADD HOW TO FIX VIOLATIONS HERE

Configure severity

Via ruleset file.

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

Via #pragma directive.

#pragma warning disable IDISP025 // Class with no virtual dispose method should be sealed
Code violating the rule here
#pragma warning restore IDISP025 // Class with no virtual dispose method should be sealed

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

#pragma warning disable IDISP025 // Class with no virtual dispose method should be sealed

Via attribute [SuppressMessage].

[System.Diagnostics.CodeAnalysis.SuppressMessage("IDisposableAnalyzers.Correctness", 
    "IDISP025:Class with no virtual dispose method should be sealed", 
    Justification = "Reason...")]