I would like MSBuild to fail on the specific warning MSB3274 (which is what you get when a reference cannot be resolved because it was built against a higher version than the currently targeted framework).
I tried
MSBuild.exe .\test.csproj /p:Configuration=Release /p:Platform=AnyCPU /p:WarningsAsErrors=MSB3274
but the warning is still treated as a warning, and the build succeeds.
How can I get an error from MSBuild if the build produces this specific warning?
About the "question already has answer" note: the answer to the question "MSBuild: Treat single warning as error" does not work in this case, as I stated in the example where I'm already using the WarningsAsErrors
property.