Is there any way to disable specific MSBuild warning (e.g. MSB3253) when running MSBuild from command line? My build script calls msbuild.exe much the following way:
msbuild.exe MySolution.sln /t:Rebuild /p:Configuration=Release
I've found out that I can suppress C# warnings (e.g. CS0618) using another parameter for msbuild.exe:
msbuild.exe MySolution.sln /t:Rebuild /p:Configuration=Release /p:NoWarn=0618
However, this approach doesn't work for MSBuild warnings. Maybe there is another magic property to set?
I'm using .NET 3.5 and VS2008.
According to this thread in the MSDN Forum MSBuild warnings can't be suppressed.
For MSB3253 you can just set in project file (*.csproj) that cause such warning.
I've managed to supress the warning level with
/p:WarningLevel=X
For those Googling this now (like me): the upcoming MSBuild 15.0 (to be released with Visual Studio 2017, I presume) will finally implement the
/NoWarn
option to suppress specific warnings (as well as/WarnAsError
to treat either specific warnings or all warnings as errors).