-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Common.targets doesn't promote TreatWarningsAsErrors to MSBuildTreatWarningsAsErrors #10871
Comments
We've implemented the intended solution here. Then we had to roll it back due to breaking sdk tests while updating msbuild dependencies. Current status:
There are several possible ways forward:
@baronfel, what do you think please? |
Adding @aortiz-msft for visibility and insight into the impact to NuGet |
After too much investigation of MSBuild flags vs CSC compiler flags I tracked down why the build is failing for my PR. It's due to Solution level warnings (which I'd never heard of but which include things like NuGet warnings) not respecting the project level `WarningsNotAsErrors` flag and MSBuild doing more than what CSC does when building. There's an open MSBuild issue to fix this but they recently had to revert a fix PR: dotnet/msbuild#10871 (comment)
@SimaTian reached out to me offline about this. I am comfortable with the 1st proposed path forward in #10871 (comment). MSBuildTreatWarningsAsErrors came after TreatWarningsAsErrors. It will always be a breaking change. I don't have data on how often MSB warnings exist in builds but feels like something that happens quite frequently in large repos. I think #10801 is way more important. |
Common.targets does respect the "plain property" version of some warning-related settings:
msbuild/src/Tasks/Microsoft.Common.CurrentVersion.targets
Lines 668 to 672 in 69b3e7a
but it doesn't do the broader setting
MSBuildTreatWarningsAsErrors
in the same way.This adds to the confusion about which settings to use.
The text was updated successfully, but these errors were encountered: