Topic | Value |
---|---|
Id | IDISP006 |
Severity | Warning |
Enabled | True |
Category | IDisposableAnalyzers.Correctness |
Code | FieldAndPropertyDeclarationAnalyzer |
The member is assigned with a created IDisposable
s within the type. Implement IDisposable and dispose it.
The type creates IDisposable(s) and assigns it to a member. Hence it must implement IDisposable and dispose the member.
Use the code fixes or manually implement IDisposable
Configure the severity per project, for more info see MSDN.
#pragma warning disable IDISP006 // Implement IDisposable
Code violating the rule here
#pragma warning restore IDISP006 // Implement IDisposable
Or put this at the top of the file to disable all instances.
#pragma warning disable IDISP006 // Implement IDisposable
[System.Diagnostics.CodeAnalysis.SuppressMessage("IDisposableAnalyzers.Correctness",
"IDISP006:Implement IDisposable",
Justification = "Reason...")]