Skip to content

Fix HelixTestRunner using the wrong version of dotnet-ef - #65676

Merged
wtgodbe merged 4 commits into
mainfrom
wtgodbe/FixTemplates
Mar 6, 2026
Merged

Fix HelixTestRunner using the wrong version of dotnet-ef#65676
wtgodbe merged 4 commits into
mainfrom
wtgodbe/FixTemplates

Conversation

@wtgodbe

@wtgodbe wtgodbe commented Mar 6, 2026

Copy link
Copy Markdown
Member

We attempt to bundle the latest version of dotnet-ef with the Helix correlation payload, so that the tests can use it. However, dotnet-ef was never actually getting restored, and we had no check for whether or not it existed on disk when we tried to bundle it with the Helix payload. As a result, dotnet tool install would just use the latest stable version on nuget.org. This just started causing some template tests to fail because there was recently an API breaking change in EF that's incompatible with the latest stable dotnet-ef.

Additionally, some of the templates explicitly depend on Microsoft.EntityFrameworkCore.Tools, which references Microsoft.EntityFrameworkCore.Design >= 8.0.0. That 8.0.0 version was the one actually being restored - we just never noticed because until now, it was compatible with the latest version of the package. But there was a breaking change in 11, which surfaced the fact that we were using the 8.0.0 version. The fix for that is to add an explicit PrivateAssets=all PackageRef to the current version of Microsoft.EntityFrameworkCore.Design.

@wtgodbe
wtgodbe requested a review from a team as a code owner March 6, 2026 04:33
Copilot AI review requested due to automatic review settings March 6, 2026 04:33
@wtgodbe

wtgodbe commented Mar 6, 2026

Copy link
Copy Markdown
Member Author

/azp list

@github-actions github-actions Bot added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Mar 6, 2026
@azure-pipelines

Copy link
Copy Markdown

@wtgodbe

wtgodbe commented Mar 6, 2026

Copy link
Copy Markdown
Member Author

/azp run aspnetcore-template-tests-pr

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@wtgodbe

wtgodbe commented Mar 6, 2026

Copy link
Copy Markdown
Member Author

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a CI issue where the Helix test runner was installing the latest stable version of dotnet-ef instead of the prerelease version bundled in the Helix correlation payload. During preview periods, dotnet tool install defaults to stable versions, causing template tests to use an incompatible older version (10.0.3) instead of the expected 11.0.0-preview version.

Changes:

  • Added the --prerelease flag to the dotnet tool install dotnet-ef command in the Helix test runner, ensuring the bundled prerelease nupkg is installed during preview periods.

@wtgodbe

wtgodbe commented Mar 6, 2026

Copy link
Copy Markdown
Member Author

@wtgodbe

wtgodbe commented Mar 6, 2026

Copy link
Copy Markdown
Member Author

The Microsoft.EntityFrameworkCore.Tools package depends on
Microsoft.EntityFrameworkCore.Design >= 8.0.0 (minimum). NuGet resolves
this transitive dependency to 8.0.0, which is incompatible with the
11.0.0-preview.3 Abstractions assembly (the AbstractionsStrings.ArgumentIsEmpty
method signature changed). This causes MissingMethodException when running
dotnet-ef migrations on template projects.

Fix by adding an explicit PackageReference for Design with the correct
version in the template csproj.in files, so the transitive dependency
from Tools is overridden with a version-matched package.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@wtgodbe

wtgodbe commented Mar 6, 2026

Copy link
Copy Markdown
Member Author

@wtgodbe wtgodbe changed the title Allow HelixTestRunner to restore prerelease versions of dotnet-ef Fix HelixTestRunner using the wrong version of dotnet-ef Mar 6, 2026
@SamMonoRT

Copy link
Copy Markdown
Member

@AndriySvyryd --- please take a look

@wtgodbe

wtgodbe commented Mar 6, 2026

Copy link
Copy Markdown
Member Author

/backport to release/10.0

@github-actions

github-actions Bot commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

Started backporting to release/10.0 (link to workflow run)

@wtgodbe
wtgodbe merged commit 42a65bf into main Mar 6, 2026
25 checks passed
@wtgodbe
wtgodbe deleted the wtgodbe/FixTemplates branch March 6, 2026 22:30
@dotnet-policy-service dotnet-policy-service Bot added this to the 11.0-preview3 milestone Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants