Code Analysis for Managed Code Warnings

The Managed Code Analysis tool provides warnings that are meant to improve managed code libraries in areas such as design, localization, performance, and security. Each warning signifies a violation of a Managed Code Analysis rule. This section provides in-depth discussions and examples for each of the Managed Code Analysis warnings. The information shown in the following table is provided in the rule topic associated with each warning.

Item Description

Type

The TypeName for the rule.

CheckId

The unique identifier for the rule. CheckId and Category are used for in-source suppression of a warning.

Category

The category of the warning.

Breaking Change

Whether the fix for a violation of the rule constitutes a breaking change. Breaking change means that an assembly that has a dependency on the target that caused the violation will not re-compile with the new fixed version or might fail at runtime due to the change. When multiple fixes are available and at least one fix is a breaking change and one fix is not, both 'Breaking' and 'NonBreaking' are specified.

Cause

The specific managed code that causes the rule to generate a warning.

Description

Discusses the issues behind the warning.

How to Fix Violations

Explains how to change the source code to satisfy the rule and prevent it from generating a warning.

When to Exclude Warnings

Describes when it is safe to exclude a warning from the rule.

Example Code

Examples that violate the rule and "fixed" examples that satisfy the rule.

Related Warnings

Related warnings.

See Also

Related topics from the Microsoft .NET Framework Design Guidelines and the .NET Framework SDK.

In This Section

Design Warnings

Warnings that support proper library design as specified by the .NET Framework Design Guidelines.

Globalization Warnings

Warnings that support world-ready libraries and applications.

Interoperability Warnings

Warnings that support interacting with COM clients.

Maintainability Warnings

Warnings that support library and application maintenance.

Naming Warnings

Warnings that support adherence to the naming conventions of the .NET Framework Design Guidelines.

Performance Warnings

Warnings that support high performance libraries and applications.

Reliability Warnings

Warnings that support library and application reliability, such as correct memory and thread usage.

Security Warnings

Warnings that support safer libraries and applications.

Usage Warnings

Warnings that support proper usage of the .NET Framework.