Respect warnings as errors warnings as messages and warnings not as errors #11342
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #10871
Only a partial fix due to the TreatWarningsAsErrors issues, for more detail see the linked ticket.
Context
The MSBuild currently has an odd way of handling the WarningsAsErrors, WarningsNotAsErrors and WarningsAsMessages properties as opposed to their MSBuild<> counterparts. This is due to the way that these are translated in a MSBuild target, which has some issues. See the linked tickets.
This is a PR to unify the behavior, with the caveat that the TreatWarningsAsErrors which is also an offender is excluded since it is currently a breaking change for many builds.
Hidden behind changewave 17.14
Changes Made
Unification of
WarningsAsErrors
WarningsNotAsErrors
WarningsAsMessages
with their MSBuild<> counterpart on the engine level.
Testing
Unit testing in WarningsAsMessagesAndErrors_Tests.cs
Notes
I've left the tests for TreatWarningsAsErrors tests in a disabled / commented state. If we want to push forward with the further unification down the line, this will be useful. If this is too far in the future, I can remove them altogether.