Bump NuGet.Packaging to 7.9.0 to match the SDK's NuGet version - #677
Merged
dennisdoomen merged 3 commits intoSep 25, 2026
Merged
dennisdoomen merged 3 commits into
dennisdoomen merged 3 commits into
Conversation
The .NET 10 SDK loads NuGet.Frameworks 7.9.0.0 into MSBuild. The pinned NuGet.Packaging 6.14.3 loaded NuGet.Frameworks 6.14.3 into the same build-host process, so every ./build.sh run failed at Compile once CI moved from SDK 10.0.302 to 10.0.400: InvalidProjectFileException: The expression "[MSBuild]::GetTargetFrameworkIdentifier(net10.0)" cannot be evaluated. Could not load file or assembly 'NuGet.Frameworks, Version=7.9.0.0'. NuGet 7.0 only removed APIs that were already obsolete. This repo uses NuspecReader, PackageArchiveReader, PackageFolderReader, VersionRange, NuGetVersion and NuGetFramework, none of which changed. NuGet 7.x drops netstandard2.0. Fallout.Tooling and Fallout.Tooling.Generator still target it, so those legs now restore .NET Framework assets and emit NU1701. That is a warning, not an error, and is tracked in the issue. Closes Fallout-build#638 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
dennisdoomen
marked this pull request as ready for review
September 19, 2026 13:45
dennisdoomen
marked this pull request as draft
September 19, 2026 13:52
Bumping NuGet.Packaging to 7.9.0 let central transitive pinning carry NuGet.Common, NuGet.Configuration, NuGet.Frameworks, and NuGet.Versioning up to 7.9.0 too, since they're dependencies of NuGet.Packaging. NuGet.Protocol and NuGet.Resolver sit on the other side of that dependency edge (they depend on NuGet.Packaging, not the reverse), so transitive pinning left them at the 6.3.4 pulled in by Microsoft.CodeAnalysis.Analyzer.Testing 1.1.2. That mismatch broke every Fallout.Migrate.Analyzers.Specs test at runtime: NuGet.Protocol 6.3.4 calls NuGet.Frameworks.NuGetFrameworkFullComparer's constructor expecting its old accessibility, throws MethodAccessException against the loaded 7.9.0 build, and Microsoft.CodeAnalysis.Testing's ReferenceAssemblies helper (which resolves packages over NuGet.Protocol at test time) fails before any test body runs. Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit has no release past 1.1.2, and that version hard-pins Microsoft.CodeAnalysis.Analyzer.Testing to exactly 1.1.2 ([1.1.2, 1.1.2]), so there's no newer version to pick up a matching NuGet.Protocol. Pinning it centrally alongside NuGet.Packaging is the only lever available. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ing-7x-nonbreaking # Conflicts: # Directory.Packages.props
dennisdoomen
enabled auto-merge (squash)
September 25, 2026 06:19
dennisdoomen
disabled auto-merge
September 25, 2026 06:19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #638.
What changed
NuGet.Packaging6.14.3 → 7.9.0 inDirectory.Packages.props, plus twoNoWarnentries for theNU1701warning this creates. Also pinsNuGet.ProtocolandNuGet.Resolverto 7.9.0 (see below). No target framework changes, no public API changes.Why
The .NET 10 SDK loads
NuGet.Frameworks 7.9.0.0into the MSBuild process. The pinnedNuGet.Packaging6.14.3 loadsNuGet.Frameworks 6.14.3into that same process, so every./build.shrun fails atCompileon SDK 10.0.400 with:NuGet 7.0 only removed APIs that were already marked obsolete. This repo uses
NuspecReader,PackageArchiveReader,PackageFolderReader,VersionRange,NuGetVersion, andNuGetFramework. None of them changed.NuGet 7.x no longer ships a
netstandard2.0build.Fallout.ToolingandFallout.SourceGeneratorsstill targetnetstandard2.0, so restoring them now pulls in.NET Frameworkcompatibility assets instead and emitsNU1701. That is a warning, not an error. BothNoWarnadditions in this PR just silence it. No target framework is removed and no consumer-facing behavior changes.The NuGet.Protocol / NuGet.Resolver pin
The first version of this PR broke all 14 tests in
Fallout.Migrate.Analyzers.SpecswithSystem.MethodAccessExceptiononNuGet.Frameworks.NuGetFrameworkFullComparer..ctor().Those specs use
Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnit1.1.2, which pins itsMicrosoft.CodeAnalysis.Analyzer.Testingdependency to exactly1.1.2. That package in turn pinsNuGet.ProtocolandNuGet.Resolverto6.3.4. BumpingNuGet.Packagingto 7.9.0 moved every package below it (NuGet.Common,NuGet.Configuration,NuGet.Frameworks,NuGet.Versioning) up to 7.9.0 through central transitive pinning, since they are dependencies ofNuGet.Packaging.NuGet.ProtocolandNuGet.Resolverdepend onNuGet.Packaginginstead of the other way round, so transitive pinning does not touch them, and they stayed at6.3.4.Microsoft.CodeAnalysis.Testing'sReferenceAssemblieshelper resolves packages overNuGet.Protocolat test time, so it now called into aNuGet.Frameworksbuild whose member accessibility no longer matched what the6.3.4build ofNuGet.Protocolexpected. That is the source of theMethodAccessException.There is no newer version of
Microsoft.CodeAnalysis.CSharp.Analyzer.Testing.XUnitto pick up a matchingNuGet.Protocolversion. Its nuspec pinsMicrosoft.CodeAnalysis.Analyzer.Testingto the exact range[1.1.2, 1.1.2], so a central override cannot bump the base package either. PinningNuGet.ProtocolandNuGet.Resolverto 7.9.0 directly inDirectory.Packages.propsis the only way to unify the wholeNuGet.*family, andCentralPackageTransitivePinningEnabledpicks up both pins with no other project changes needed.Relation to #639
#639 carries the same version bump but treats it as a breaking change. It uses
target/vNextinstead oftarget/vCurrentand holds the fix for next year's major, reasoning thatnetstandard2.0support is going away. This PR keeps everynetstandard2.0target as-is. The warning is cosmetic, so this can ship now as an ordinary bug fix and close #638 immediately instead of waiting for the next major.Verification
./build.sh Compilefails on SDK 10.0.400 without this change, succeeds with it.dotnet test tests/Fallout.Migrate.Analyzers.Specs: 14/14 pass (all 14 failed before theNuGet.Protocol/NuGet.Resolverpin was added).dotnet restore fallout.slnx: clean, no new warnings.I've also verified this end-to-end against a real consumer:
Created a local version of the Fallout NuGet packages with the changes in this PR.
First reproduced the issue in FluentAssertions by removing the
<PackageReference Include="NuGet.Frameworks" Version="7.9.0" />on .NET SDK 10.0.400. Note that I had to downgrade from 10.0.401 to 10.0.400 to reproduce it. This gave meInvalidProjectFileException: The expression "[MSBuild]::GetTargetFrameworkIdentifier(net8.0)" cannot be evaluated. Could not load file or assembly 'NuGet.Frameworks, Version=7.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The located assembly's manifest definition does not match the assembly reference. (0x80131040) C:\Program Files\dotnet\sdk\10.0.401\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targetsBumped the
Fallout.CommonandFallout.Componentsreferences to the locally built pre-release Fallout packages.Verified that the error went away.
🤖 Partially generated with Claude Code