Bewerken

Share via


SuppressMessageAttribute.Scope Property

Definition

Gets or sets the scope of the code that is relevant for the attribute.

public:
 property System::String ^ Scope { System::String ^ get(); void set(System::String ^ value); };
public string Scope { get; set; }
public string? Scope { get; set; }
member this.Scope : string with get, set
Public Property Scope As String

Property Value

The scope of the code that is relevant for the attribute.

Remarks

The Scope property is an optional argument that specifies the metadata scope for which the attribute is relevant. The following table shows the possible values.

Value Description
"member" Suppresses warnings against a member.
"module" Suppresses warnings against an assembly. It is a global suppression that applies to the entire project.
"namespace" This scope suppresses warnings against the namespace itself. It does not suppress warnings against types within the namespace.
"namespaceanddescendants" Suppresses warnings in a namespace and all its descendant symbols. This value is ignored by legacy code analysis.
"type" Suppresses warnings against a type.

For legacy code analysis, "resource" is also a valid value. For more information about scopes, see Suppress code analysis warnings.

Applies to