-
Notifications
You must be signed in to change notification settings - Fork 387
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
Make warnaserror work from the property pages. #2368
Conversation
…reatSpecificWarningsAsErrors property whereas the compiler just understands WarningsAsErrors property. Swtich the rule to persist WarningsAsErrors
Tagging @MattGertz for approval. |
@@ -106,7 +106,7 @@ | |||
Visible="False" | |||
ReadOnly="True" /> | |||
|
|||
<StringProperty Name="TreatSpecificWarningsAsErrors" | |||
<StringProperty Name="WarningsAsErrors" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to send both properties to NuGet? What if someone specifically enters <TreatSpecificWarningsAsErrors>NU1000</TreatSpecificWarningsAsErrors>
? Or do we need to deprecate that because it will not be reflected in the property page?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya TreatSpecificWarningsAsErrors
is not a property that has meant anything to anyone in the past. It looks like the DTE property is called that and so we just had a StringProperty with that same name by mistake. The only projects that will have this are ones where someone tried to set WarnAsError from the proppages and it wouldn't have worked. So its dead code in their project files. I don't see any reason to support both.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, we should update the NuGet spec at https://github.com/NuGet/Home/wiki/Improved-NuGet-warnings to use <WarningsAsErrors>
in Scenario-1, step 5
/cc @anangaur
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we should. Tagging @emgarten again to make sure that the implementation does that.
Tagging @MattGertz for approval. |
Customer scenario
If a user goes to the build property pages and enters a warning number in the "Treat Warnings as errors" textbox then those warnings weren't being treated as errors.
This is because the prop page was persisting the warnings to a property called TreatSpecificWarningsAsErrors in the project file - however, the compiler only understands a
WarningsAsErrors
property. Making the prop page persist the warnings as WarningsAsErrors instead.@natidea @emgarten - note that this means that NuGet needs to read the WarningsAsErrors property as well. I've updated the nomination rule as well so that we send WarningsAsErrors to NuGet.
Bugs this fixes:
https://devdiv.visualstudio.com/DevDiv/_workitems?id=435264&_a=edit&triage=true
Workarounds, if any
Manually edit the project file.
Risk
Low - just changing the property name.
Performance impact
Low - just changing the property name.
Is this a regression from a previous update?
No
How was the bug found?
VS Feedback - https://developercommunity.visualstudio.com/content/problem/55418/cs4014-warning-as-error.html
@dotnet/project-system