本文介绍了VB.Net是否具有与#pragma warning disable / restore等效的功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我找到了一种禁用整个VB.NET项目警告的方法,但这是非常不可取的。我想最多禁用一种方法范围的警告。逐行禁用和还原会更好。例如,C#已禁用 #pragma警告禁用
(和还原
)。 VB.NET有这样的东西吗?
I've found a way to disable warnings for an entire VB.NET project, but that is very undesirable. I would like to disable a certain warning for the scope of one method at most. A line-by-line disable and restore would be better. For example, C# has #pragma warning disable
(and restore
). Does VB.NET have anything like this?
推荐答案
如果使用的是Visual Studio 2015,答案是肯定的,是的。 。语法为 #Disable Warning BC40000
和 #Enable Warning BC40000
If you are using Visual Studio 2015, the answer is yes, yes it does. The syntax is #Disable Warning BC40000
and #Enable Warning BC40000
这篇关于VB.Net是否具有与#pragma warning disable / restore等效的功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!