How to suppress a StyleCop warning?

后端 未结 12 1389
心在旅途
心在旅途 2020-11-27 18:23

I\'m using StyleCop and want to suppress some warning which does not suit my style. I prefer to have solution for

1) in-line code suppressing
2) global setting

12条回答
  •  伪装坚强ぢ
    2020-11-27 19:00

    If you've installed StyleCop, you can right-click your project and there will be a StyleCop option. Click this and you'll see you can prevent certain rules from even running against your project. Moreover, you can create a separate rules file to share between different projects. This means you can configure the rules once the way you want them and then share that configuration between all your projects.

    For individual overrides, SuppressMessage is the way to go.

提交回复
热议问题