[vs17.12] Consistently respect unprefixed Warning-as-error/message/warning properties #11007
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.
Backport of #10942.
Fixes #10877 and #10873.
Work item (Internal use):
Summary
Respect
WarningsAsMessages
,WarningsAsErrors
,WarningsNotAsErrors
, andTreatWarningsAsErrors
in addition to theirMSBuild
-prefixed versions in all projects, not just ones that importMicrosoft.Common.CurrentVersion.targets
.Customer Impact
Reduced complexity in opting to keep warnings as warnings, making it easier to configure warnings how you expect.
Regression?
No, this behavior is longstanding. It's higher severity now due to the NuGet Audit warnings, which are often created in one project (where a package is referenced) but raised in another (where the restore actually happened), which may have the easy-to-type form of the property but not the respected-before-this-change one.
Testing
New and existing automated tests.
Risk
Medium-low. Users almost certainly intended this behavior and it works this way in most project types. To mitigate risk further, the behavior can be reverted to the prior behavior with an environment variable (changewave).