Explain System.Diagnostics.CodeAnalysis.SuppressMessage

前端 未结 2 812
既然无缘
既然无缘 2021-02-04 05:14

I have this kind of code in some applications (from microsoft)

[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage(
  \"Microsoft.Naming\", 
  \"CA1702:Co         


        
2条回答
  •  长情又很酷
    2021-02-04 06:09

    This attribute is used by Team Foundation Server's (TFS) code analysis functionality to exclude code fragments that would otherwise trigger warnings. You can safely remove them if you're not using TFS code analysis.

    The attributes can be added by hand or, more usually, are added automatically via the Visual Studio GUI when the "Suppress Message" option is selected in the error list.

提交回复
热议问题