Repository navigation
dotnet package update --vulnerable works with TreatWarningsAsErrors - #7605
Merged
Merged
Conversation
|
NuGet/Home#15009 was closed as duplicate of the issue this fixes but it contains some more scenarios, does this PR fix them as well? It looks like it but just wanted to confirm. |
nkolev92
reviewed
Jul 31, 2026
kartheekp-ms
reviewed
Aug 4, 2026
kartheekp-ms
reviewed
Aug 4, 2026
kartheekp-ms
approved these changes
Aug 7, 2026
|
Title of the PR has a typo should be |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Bug
Fixes: NuGet/Home#14988
Description
dotnet package update --vulnerablefinds packages to update by doing an in-memory restore (not writing assets file, etc), and looking for NU1901-4 restore log messages. But it can't tell the difference between warnings treated as errors causing restore to fail, or if there's some other failure. If there's a different failure, then the assets file on disk could be invalid, so package update should not continue.One way to avoid this is to disable TreatWarningsAsErrors for the in-memory (preview) restore. If the assets file was already out-of-sync with the project, there's no harm. If the assets file is up to date, then restore's no-op check fails and restore will have a slower code path. But we can be confident that the result will be accurate.
PR Checklist
Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.N/A