Does VB.Net have an equivalent to #pragma warning disable/restore?

自古美人都是妖i 提交于 2019-12-01 03:05:27

If you are using Visual Studio 2015, the answer is yes, yes it does. The syntax is #Disable Warning BC40000 and #Enable Warning BC40000

https://github.com/dotnet/roslyn/wiki/Languages-features-in-C%23-6-and-VB-14

Unfortunately the answer is no, the VB.NET compiler doesn't support suppression of warnings in such a manner. You would have to re-factor your VB.NET code or look at some other alternative like writing some of the code in C#.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!