Suppress a warning for all projects in Visual Studio

前端 未结 6 1327
心在旅途
心在旅途 2021-01-04 00:48

I\'ve seen answers showing how to suppress a warning for a specific line of code or for a specific project. I don\'t want that.

I want to suppress a specific warning

6条回答
  •  佛祖请我去吃肉
    2021-01-04 01:18

    You can use the SuppressMessage attribute present under System.Diagnostics.CodeAnalysis namespace like

    [SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "args")]
    

    Well as you have edited saying I want to suppress a specific warning for all of my projects

    You can't do that for a entire project wise AFAIK. But check the linked post once if that helps

    How to suppress code analysis messages for all type members?

提交回复
热议问题