Fix NU1903 suppression: use NoWarn instead of WarningsNotAsErrors#66466
Merged
wtgodbe merged 1 commit intodotnet:mainfrom Apr 24, 2026
Merged
Fix NU1903 suppression: use NoWarn instead of WarningsNotAsErrors#66466wtgodbe merged 1 commit intodotnet:mainfrom
wtgodbe merged 1 commit intodotnet:mainfrom
Conversation
WarningsNotAsErrors does not prevent NuGet restore from promoting audit warnings to errors — NuGet has its own WarningsAsErrors mechanism. Switch to NoWarn which suppresses the warning at all stages including restore. This fixes the internal pipeline which has been 100% broken for 48+ hours despite the previous fix in dotnet#66423. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Member
Author
|
/backport to release/10.0 |
Contributor
|
Started backporting to |
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the RepoTasks MSBuild tool project’s NuGet vulnerability audit suppression so it works during NuGet restore (not just build), unblocking CI failures caused by NU1903 being emitted as an error in restore.
Changes:
- Replaces
WarningsNotAsErrorswithNoWarnforNU1901–NU1904inRepoTasks.csproj. - Expands the comment to document why
NoWarnis required to affect restore-time audit errors.
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.
Problem
The internal pipeline has been 100% broken for 48+ hours despite the NU1903 suppression in #66423. The previous fix used
WarningsNotAsErrors, which only works during MSBuild's build phase. NuGet restore has its own mechanism for promoting audit warnings to errors, andWarningsNotAsErrorsdoes not override it.From internal build 2959332:
Note the
Restoretelemetry category — the error fires during NuGet restore, not build.Fix
Change
WarningsNotAsErrors→NoWarnwhich suppresses the warning at all stages including restore. This matches the pattern used by other projects in the repo (Components.Testingtasks/tests/testassets).Supersedes #66423. Needs backport to
release/10.0andrelease/11.0-preview4.