Skip to content

Pin NuGet.Framework for .NET SDK 10.0.400; auto-remove on future major versions - #666

Draft
ITaluone wants to merge 2 commits into
Fallout-build:developfrom
ITaluone:feat/migration/add-nuget.framework-pin
Draft

Pin NuGet.Framework for .NET SDK 10.0.400; auto-remove on future major versions#666
ITaluone wants to merge 2 commits into
Fallout-build:developfrom
ITaluone:feat/migration/add-nuget.framework-pin

Conversation

@ITaluone

@ITaluone ITaluone commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

fallout-migrate now pins NuGet.Framework 7.9.0 on 10.x build projects, and removes that pin when the target Fallout major matches or moves beyond the marker.
I chose the marker version v11 because of various comments mentioning this version upgrade in that major version.

If someone feels to leave it until v12, please ping me on that one.

Changes

  • On Fallout 10.x, RewriteCsprojsStep inserts this block into the first ItemGroup of only the _build.csproj:
<!-- fallout-migrate:delete-at-v11:start -->
<!-- Pin the NuGet.Framework version, so .NET 10.0.400 does not cause the build to fail. -->
<PackageReference Include="NuGet.Framework" Version="7.9.0" />
<!-- fallout-migrate:delete-at-v11:end -->
  • The v11 in the marker is the next major after MigrationContext.FalloutVersion (the version fallout-migrate resolved for this run).
  • When that resolved version is already on the marker major (11), the step deletes everything from :start through :end.
  • A later major does not add a new pin. It only removes a block whose marker already matches.
  • Does nothing if the build project itself is .NETFramework (since the netstandard2.0 removage)
  • Does only pin on the build project itself (leaves any other .csproj alone)

Why?

.NET SDK 10.0.400 loads NuGet.Frameworks 7.9.0.0 while evaluating the build project. Without an explicit pin, MSBuild fails when calling e.g. Solution.MyProject.GetTargetFrameworks(). The pin is only needed on the 10.x line. The marker tells fallout-migrate to drop the block on v11 so consumers do not have to edit the csproj by hand.

Proposed workaround migration for #638

- Do not Add pin to net framework build projects
- Only add on build projects in general
@ITaluone
ITaluone requested a review from a team as a code owner August 29, 2026 15:35
@dennisdoomen
dennisdoomen marked this pull request as draft August 30, 2026 11:21
@dennisdoomen

Copy link
Copy Markdown
Collaborator

I'm going to park this one until we have settled on a path in #638. Also, upgrades between 10.x must always be backwards compatible and fallout-migrate is only supposed to be used between Nuke -> Fallout 10 -> Fallout 10 + 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants