C#


ROSLYN.DESIGN.CA1001 : Types that own disposable fields should be disposable (C#)

See Roslyn-Detected C# Warning Classes for more information.

Summary

A class declares and implements an instance field that is a System.IDisposable type, and the class does not implement IDisposable. A class that declares an IDisposable field indirectly owns an unmanaged resource and should implement the IDisposable interface.

This check corresponds to Roslyn rule CA1001. For full rule details, see the Microsoft website: CA1001.

Properties

Class Name Types that own disposable fields should be disposable (C#)
Significance reliability
Mnemonic ROSLYN.DESIGN.CA1001
Categories None
Availability Available for C# only.
Enabling Checks for this warning class are enabled by default. To disable them, add the following WARNING_FILTER rule to the project configuration file.
WARNING_FILTER += discard class="Types that own disposable fields should be disposable (C#)"

Relevant Configuration File Parameters

The following configuration file parameters affect checks for this warning class.