通过


SuppressMessageAttribute.Scope 属性

定义

获取或设置与属性相关的代码的范围。

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

属性值

与属性相关的代码的范围。

注解

Scope 属性是一个可选参数,指定属性相关的元数据范围。 下表显示了可能的值。

价值 说明
"member" 禁止对成员发出警告。
"module" 禁止对程序集发出警告。 它是应用于整个项目的全局抑制。
"namespace" 此范围禁止针对命名空间本身发出警告。 它不会禁止针对命名空间中的类型发出警告。
"namespaceanddescendants" 取消命名空间及其所有后代符号中的警告。 旧代码分析将忽略此值。
"type" 禁止针对类型发出警告。

对于 旧代码分析"resource" 也是一个有效值。 有关范围的详细信息,请参阅 禁止显示代码分析警告

适用于