-
Notifications
You must be signed in to change notification settings - Fork 252
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
Solution level NuGetAuditLevel settings #13022
Comments
@gmartinka can you try setting these properties in |
That works! I did not know about this option. It is basically a default so anything, like |
I am going to mark this as closed since it solves my problem. A UI setting would be nice but probably not necessary given this option. |
That's great to hear, glad that helped. Be aware that some properties that are semicolon delimited like <PropertyGroup>
<NoWarn>$(NoWarn);123</NoWarn>
<WarningsNotAsErrors>$(WarningsNotAsErrors);456</WarningsNotAsErrors>
</PropertyGroup> Then in individual projects you can do the same thing and all values are used instead of being entirely overridden. |
Also, there will be VS project properties coming for NuGetAudit settings, but a partner teams owns the project settings window |
@gmartinka did you do something like this in a <Project>
<PropertyGroup>
<WarningsNotAsErrors>$(WarningsNotAsErrors);NU1901;NU1902;NU1903;NU1904</WarningsNotAsErrors>
</PropertyGroup>
</Project> Because this doesn't work for me in two separate solutions. It does work though if I add the same |
Thit is my Directory.Build.props, and that file lives in the root directory where all my source is stored so it works on all the slns in that directory.
|
Thanks, yeah, that's virtually the same. I also tried exactly that, i.e. without
|
I created a sample project with a Directory.Build.props that sets WarningsNotAsErrors: gh13022.zip I can't reproduce the behaviour you're reporting. |
Thank you! Note that I've run
With your sample, this indeed only produces a warning (one with each command). When just running the build alone (or running it with
This is something I can live with, though I'd expect the config to be consistent. And I still get audit advisory as error on build for Orchard Core's solution somehow, despite following the same pattern. So, this is some issue with that solution that I can't find (I don't see any config reverting Oh well. I addressed our CI builds failing on new warnings with |
Ok, running locally, it appears that According to msbuild's CLI docs, there's a The reason I'm so confident that it's MSBuild interpreting the warnings as errors is because years ago I made NuGet output "Warning As Error:" for all warnings that are elevated to errors by NuGet's own logic. When I run |
I also tried Do I understand correctly that you think this is an MSBuild bug, then? |
But it does appear to be an MSBuild specific thing. I wouldn't be surprised if it's "not a bug" though. There's a reasonable chance that these |
OK, thank you! |
This worked for me:
|
NuGet Product(s) Involved
Visual Studio Package Management UI
The Elevator Pitch
When dealing with a solution with a lot of projects it is difficult to delay dealing with the
NuGetAudit
errors.A solution level
NuGetAuditLevel
setting to adjust the entire solution would be appreciated.Additional Context and Details
My solution uses
TreatWarningsAsErrors
and after updating VS to 17.8.0 I now have 26 failed projects in my solution due to nuget audit errors. My team has opted to work on these package updates on a separate timeline which means I need a way to proceed with my work without updating. Changing the audit level in 26 projects is annoying and I will want to change it back when I push my work so that the vulnerabilities stay visible.The text was updated successfully, but these errors were encountered: