Skip to content

Fix NU1903 suppression: use NoWarn instead of WarningsNotAsErrors#66466

Merged
wtgodbe merged 1 commit intodotnet:mainfrom
wtgodbe:wtgodbe/fix-nu1903-restore
Apr 24, 2026
Merged

Fix NU1903 suppression: use NoWarn instead of WarningsNotAsErrors#66466
wtgodbe merged 1 commit intodotnet:mainfrom
wtgodbe:wtgodbe/fix-nu1903-restore

Conversation

@wtgodbe
Copy link
Copy Markdown
Member

@wtgodbe wtgodbe commented Apr 24, 2026

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, and WarningsNotAsErrors does not override it.

From internal build 2959332:

RepoTasks.csproj(0,0): error NU1903: (NETCORE_ENGINEERING_TELEMETRY=Restore) Package 'System.Security.Cryptography.Xml' 8.0.0 has a known high severity vulnerability

Note the Restore telemetry category — the error fires during NuGet restore, not build.

Fix

Change WarningsNotAsErrorsNoWarn which suppresses the warning at all stages including restore. This matches the pattern used by other projects in the repo (Components.Testing tasks/tests/testassets).

Supersedes #66423. Needs backport to release/10.0 and release/11.0-preview4.

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>
Copilot AI review requested due to automatic review settings April 24, 2026 19:44
@wtgodbe wtgodbe requested a review from a team as a code owner April 24, 2026 19:44
@github-actions github-actions Bot added the needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically label Apr 24, 2026
@wtgodbe
Copy link
Copy Markdown
Member Author

wtgodbe commented Apr 24, 2026

/backport to release/10.0

@github-actions
Copy link
Copy Markdown
Contributor

Started backporting to release/10.0 (link to workflow run)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 WarningsNotAsErrors with NoWarn for NU1901NU1904 in RepoTasks.csproj.
  • Expands the comment to document why NoWarn is required to affect restore-time audit errors.

@wtgodbe wtgodbe merged commit 555c870 into dotnet:main Apr 24, 2026
31 checks passed
@dotnet-policy-service dotnet-policy-service Bot added this to the 11.0-preview5 milestone Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants