From 46e2fbf0f799ef36d76f585ecc88ca570311ffe8 Mon Sep 17 00:00:00 2001 From: Timothy Date: Fri, 26 Jun 2026 22:22:48 +0200 Subject: [PATCH] build: don't fail restore on low/moderate/high NuGet audit advisories .NET 10's NuGet audit promotes vulnerable transitive packages to NU1901-1904 warnings during restore; the app projects set TreatWarningsAsErrors=true, so restore failed on NCalcSync 5.11.0 (moderate) and SQLitePCLRaw 2.1.10 (high). Demote NU1901/NU1902/NU1903 to warnings in Directory.Build.props (NU1904 critical still errors). Also COPY Directory.Build.props/.targets in the Dockerfile before restore so the image build honors the same props as local/CI builds (it previously copied only the .sln). Underlying deps tracked in #8. Refs #4, #8. --- Directory.Build.props | 7 +++++++ docker/Dockerfile | 3 +++ 2 files changed, 10 insertions(+) diff --git a/Directory.Build.props b/Directory.Build.props index 22f540d9b..41e553a90 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -3,5 +3,12 @@ develop false true + + $(WarningsNotAsErrors);NU1901;NU1902;NU1903 diff --git a/docker/Dockerfile b/docker/Dockerfile index 24c4019c7..24de18ecf 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -24,6 +24,9 @@ COPY scripts/scripted-schedules/. /app/scripted-schedules/ # copy csproj and restore as distinct layers COPY *.sln . +# repo-wide MSBuild props/targets (incl. NuGet-audit warning exemptions) must be +# present before restore so the image build matches local/CI builds +COPY Directory.Build.props Directory.Build.targets ./ COPY artwork/* ./artwork/ COPY ErsatzTV/*.csproj ./ErsatzTV/ COPY ErsatzTV.Application/*.csproj ./ErsatzTV.Application/