System.Diagnostics.CodeAnalysis Namespace

The System.Diagnostics.CodeAnalysis namespace contains classes for interaction with code analysis tools. These tools are used to analyze code for conformance to coding conventions such as naming or security rules.

Classes

AllowNullAttribute

Specifies that null is allowed as an input even if the corresponding type disallows it.

DisallowNullAttribute

Specifies that null is disallowed as an input even if the corresponding type allows it.

DoesNotReturnAttribute

Specifies that a method that will never return under any circumstance.

DoesNotReturnIfAttribute

Specifies that the method will not return if the associated Boolean parameter is passed the specified value.

ExcludeFromCodeCoverageAttribute

Specifies that the attributed code should be excluded from code coverage information.

MaybeNullAttribute

Specifies that an output may be null even if the corresponding type disallows it.

MaybeNullWhenAttribute

Specifies that when a method returns ReturnValue, the parameter may be null even if the corresponding type disallows it.

NotNullAttribute

Specifies that an output is not null even if the corresponding type allows it.

NotNullIfNotNullAttribute

Specifies that the output will be non-null if the named parameter is non-null.

NotNullWhenAttribute

Specifies that when a method returns ReturnValue, the parameter will not be null even if the corresponding type allows it.

SuppressMessageAttribute

Suppresses reporting of a specific static analysis tool rule violation, allowing multiple suppressions on a single code artifact.