Skip to content

Commit 407cd42

Browse files
angularsenclaude
andcommitted
Stop failing the build on low/moderate NuGet audit advisories
The default NuGetAuditLevel is "low", which combined with TreatWarningsAsErrors=true causes restore-time NU1901/NU1902 warnings for low- and moderate-severity transitive package advisories to fail the build. We saw this with NuGet.Packaging/NuGet.Protocol 7.0.1 pulled in transitively by tooling - we cannot upgrade those without breaking other constraints, and the advisories are not actionable. Set NuGetAuditLevel=high so only high- and critical-severity audit advisories surface (and still fail the build via TreatWarningsAsErrors). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 2a60bf9 commit 407cd42

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Directory.Build.props

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@
1919
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
2020
<!-- 612: obsolete, 618: obsolete with message -->
2121
<WarningsNotAsErrors>612,618</WarningsNotAsErrors>
22+
<!--
23+
NuGet audit severity floor. Default is "low" which fails restore on any disclosed CVE
24+
regardless of impact (e.g. transitive packages with low-severity advisories that we
25+
cannot upgrade away from). "high" only audits high and critical advisories, which
26+
still surface as warnings and (via TreatWarningsAsErrors) still fail the build.
27+
Low and moderate advisories are no longer reported.
28+
-->
29+
<NuGetAuditLevel>high</NuGetAuditLevel>
2230
</PropertyGroup>
2331

2432
<!-- Build symbol package (.snupkg) to distribute the PDB file for debugging, in addition to Source Link per recommendation: https://learn.microsoft.com/en-us/dotnet/standard/library-guidance/sourcelink -->

0 commit comments

Comments
 (0)