build: bump NuGet.Packaging to 7.9.0 to unbreak the NUKE build on SDK 10.0.400

CI started failing on every branch with an assembly load error out of NUKE's
project parsing, before any test ran:

  InvalidProjectFileException: The expression
  "[MSBuild]::GetTargetFrameworkIdentifier(net10.0)" cannot be evaluated.
  Could not load file or assembly 'NuGet.Frameworks, Version=7.9.0.0'.
  The located assembly's manifest definition does not match the assembly reference.
     at Nuke.Common.ProjectModel.ProjectModelTasks.ParseProject

Nothing in the repo changed to cause it. pr.yml requests dotnet-version 10.x,
and the hosted runner moved from SDK 10.0.302 to 10.0.400. Measured, the two
SDKs ship different NuGet.Frameworks:

  SDK 10.0.300 / 10.0.302 -> NuGet.Frameworks 7.6.0
  SDK 10.0.400            -> NuGet.Frameworks 7.9.0

_build.csproj pinned NuGet.Packaging 7.6.0, which puts NuGet.Frameworks 7.6.0
in the NUKE output directory, where it shadows the SDK's own copy. The loader
accepts an assembly newer than the reference but not older, so once MSBuild
started asking for 7.9.0.0 the app-local 7.6.0 no longer satisfied it. The same
commits passed 19 hours earlier on 10.0.302.

The reference is not used by the build itself - there are no NuGet.* usages
anywhere in build/*.cs. It exists only as a transitive vulnerability override,
added in f5dc29cdc, so bumping it preserves the original intent while matching
what the current SDK ships. Staying loadable on 10.0.3xx follows from the same
newer-than-reference rule that broke the old pin.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Sipke Schoorstra 2026-08-11 23:25:33 +02:00
parent bd903f63dc
commit fe6601ab5b
No known key found for this signature in database
GPG key ID: 5C10502B28A4268F

View file

@ -20,7 +20,7 @@
<ItemGroup>
<PackageReference Include="Nuke.Components" Version="10.1.0" />
<PackageReference Include="NuGet.Packaging" Version="7.6.0" />
<PackageReference Include="NuGet.Packaging" Version="7.9.0" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="10.0.10" />
</ItemGroup>