Skip to content

Latest commit

 

History

History
50 lines (36 loc) · 1.35 KB

IDISP012.md

File metadata and controls

50 lines (36 loc) · 1.35 KB

IDISP012

Property should not return created disposable

Topic Value
Id IDISP012
Severity Warning
Enabled True
Category IDisposableAnalyzers.Correctness
Code ReturnValueAnalyzer

Description

Property should not return created disposable.

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 IDISP012 // Property should not return created disposable
Code violating the rule here
#pragma warning restore IDISP012 // Property should not return created disposable

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

#pragma warning disable IDISP012 // Property should not return created disposable

Via attribute [SuppressMessage].

[System.Diagnostics.CodeAnalysis.SuppressMessage("IDisposableAnalyzers.Correctness", 
    "IDISP012:Property should not return created disposable", 
    Justification = "Reason...")]