From 53b801123ba7c45f281c4f045389e18b3182fe02 Mon Sep 17 00:00:00 2001 From: Andreas Gullberg Larsen Date: Sat, 2 May 2026 19:40:38 +0200 Subject: [PATCH] Stop failing the build on low/moderate NuGet audit advisories PR #1657's CI failed at restore time with: error NU1901: Warning As Error: Package 'NuGet.Packaging' 7.0.1 has a known low severity vulnerability error NU1901: Warning As Error: Package 'NuGet.Protocol' 7.0.1 has a known low severity vulnerability These are pulled in transitively by build tooling (CodeGen) and cannot be upgraded without breaking other constraints. Two changes: - Add NU1901 (low) and NU1902 (moderate) to WarningsNotAsErrors in Directory.Build.props so they remain visible as warnings but no longer fail the build via TreatWarningsAsErrors. High (NU1903) and critical (NU1904) advisories still fail the build. - CodeGen.csproj had its own WarningsNotAsErrors that overrode (not appended to) the one in Directory.Build.props. Prefix it with $(WarningsNotAsErrors); so the project inherits the NU codes (and the obsolete codes) while keeping its nullability suppressions. Co-Authored-By: Claude Opus 4.7 (1M context) --- CodeGen/CodeGen.csproj | 14 ++++++++++++-- Directory.Build.props | 10 ++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/CodeGen/CodeGen.csproj b/CodeGen/CodeGen.csproj index 815ce3974a..da0c0ddb03 100644 --- a/CodeGen/CodeGen.csproj +++ b/CodeGen/CodeGen.csproj @@ -5,8 +5,18 @@ net10.0 latest enable - - 8600,8601,8603,8604,8618,8619,8625 + + $(WarningsNotAsErrors);8600;8601;8603;8604;8618;8619;8625 diff --git a/Directory.Build.props b/Directory.Build.props index 2fa148beba..d8f549a773 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -17,8 +17,14 @@ true - - 612,618 + + 612;618;NU1901;NU1902