SuppressMessageAttribute.CheckId Property

 

Gets the identifier of the static analysis tool rule to be suppressed.

Namespace:   System.Diagnostics.CodeAnalysis
Assembly:  mscorlib (in mscorlib.dll)

public string CheckId { get; }

Property Value

Type: System.String

The identifier of the static analysis tool rule to be suppressed.

Concatenated together, the Category and CheckId properties form a unique check identifier.

The following code example shows the use of the SuppressMessageAttribute attribute to suppress warnings for the Microsoft.Performance category and the CA1801 and CA1804 check identifiers. This code example is part of a larger example provided for the SuppressMessageAttribute class.

[SuppressMessage("Microsoft.Performance", "CA1801:ReviewUnusedParameters", MessageId = "isChecked")]
[SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals", MessageId = "fileIdentifier")]
static void FileNode(string name, bool isChecked)
{
    string fileIdentifier = name;
    string fileName = name;
    string version = String.Empty;
}

Universal Windows Platform
Available since 8
.NET Framework
Available since 2.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top
Show: