抑制所有方法的警告
抑制视觉工作室(以及可能是罗斯林分析仪)的所有警告的最简单方法是什么?就像我从stackoverflow答案复制到我的类的新方法一样,该代码不符合我的编码准则,但我也不想更改它,我不想插入很多PRAGMA警告禁用
指令或大量undressMessage
属性。
关于重音警告,我可以简单地将以下属性添加到该方法中:
[SuppressMessage("ReSharper", "All")]
但是,这仅适用于载荷警告,而不适合来自Visual Studio的人员。
What is the easiest way to suppress all warnings from Visual Studio (and possibly Roslyn Analyzers) for a certain method? Like I copy-paste code from a stackoverflow answer into a new method of my class and the code doesn't comply with my coding guidelines but also I don't want to change it and I don't want to insert lots of pragma warning disable
directives or lots of SuppressMessage
attributes.
Regarding ReSharper warnings I can simply add the following attribute to the method:
[SuppressMessage("ReSharper", "All")]
but this works only for the ReSharper warnings, not for those from Visual Studio.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
禁用所有方法的所有警告:
To disable all warnings for a single method: