是否可以为所有解决方案关闭特定的编译器错误消息和警告? [英] Can specific compiler error message and warnings be turned off for all solutions?
问题描述
是否可以关闭错误消息和警告,例如"这可以简化?" 我不喜欢警告告诉我如果格式在执行中没有任何区别,我的代码应该如何格式化。 我想永久地在IDE中关闭
一些警告,所以我不必在每个项目中都这样做。
Is it possible to turn off error messages and warnings like "this can be simplified?" I don't like warnings that tell me how my code should be formatted if the format doesn't make any difference in execution. I would like to turn off some warning in the IDE permanently, so I don't have to did it in each project.
除了一个全局解决方案,是否有在所有解决方案而不是每个子程序或函数中抑制这些警告的方法?
Barring a single global solution, is there a way to suppress these warning in all of a solution rather than each subroutine or function?
推荐答案
亲爱的朋友,
感谢您的发布。
请转到 工具 - >选项 - >文字编辑器 - > C# - >代码风格,
Please go to TOOLS -> Options -> Text Editor -> C# -> Code Style,
取消选中"首选成员访问表达式中的内部预定义类型关键字",然后它就会删除"名称可以简化"您正在体验的消息。
Uncheck "Prefer intrinsic predefined type keyword in member access expressions" and it'll get rid of the "Name can be simplified" message that you were experiencing.
请试一试,让我知道它是否有效。
Please give it a try and let me know if it works.
期待您的回复。
祝你好运,
Fletcher
这篇关于是否可以为所有解决方案关闭特定的编译器错误消息和警告?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!