How to disable warnings in Visual Studio for a Visual Basic Web Deployment Project

此生再无相见时 提交于 2019-11-30 09:59:35

It is possible to ignore errors, it is just in a weird place for vb.net.

Open the .vbproj file with notepad or an equivalent and find the <NoWarn> tag and add the id of the error there.

in a default 2008 winforms, I have these warnings already ignored.

<NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>

If you used Nant in your build script you could just have it re-write the version prior to compile, and you wouldn't see the warning when you are working on your local machines.

Had a very similar situation with an old VB web project, and we did not want to add the #pragma blocks all over the code calls. For some reason, adding the lines to the <NoWarn> fields did not make Visual Studio builds ignore/suppress the warnings.

However, I found a different approach. By adding this in the .vbproj file after the <NoWarn></NoWarn> area ignored the obsolete warnings in VS 2017: <DisabledWarnings>612;618</DisabledWarnings>

Common MSBuild project properties Description of configuration setting:

DisabledWarnings Suppresses the specified warnings. Only the numeric part of the warning identifier must be specified. Multiple warnings are separated by semicolons. This parameter corresponds to the /nowarn switch of the vbc.exe compiler.

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