Skip to content

chore: build for EF Core 11 on .NET 11 alongside EF Core 10 on .NET 10 - #72

Draft
grzonu wants to merge 2 commits into
cmdscale:mainfrom
grzonu:feature/multi-target-net11
Draft

grzonu wants to merge 2 commits into
cmdscale:mainfrom
grzonu:feature/multi-target-net11

Conversation

@grzonu

@grzonu grzonu commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Description

As discussed in #71: both packages now target net10.0 and net11.0 from one branch, with the dependencies chosen per target framework. The net10.0 assets are unchanged, still on EF Core 10 and Npgsql EF 10. The net11.0 assets depend on EF Core 11 and Npgsql EF 11. Nothing here is meant as official .NET 11 support: the README's release strategy is untouched.

What EF Core 11 required:

  • Npgsql EF 11 added IQuerySqlGeneratorFactory to the NpgsqlMigrationsSqlGenerator constructor, so TimescaleDbMigrationsSqlGenerator takes it under #if NET11_0_OR_GREATER. Without this, the 10.x package throws MissingMethodException on the first Migrate() under EF Core 11.
  • EF Core 11 moved IOperationReporter from Microsoft.EntityFrameworkCore.Design.Internal to Microsoft.EntityFrameworkCore.Design. Package validation therefore reports two CP0002 differences between the net10.0 and net11.0 assets of Eftdb.Design: the constructors of TimescaleCSharpModelGenerator and TimescaleDbAnnotationCodeGenerator. Both are built by dependency injection, and the source is the same for both targets, so the differences are suppressed in CompatibilitySuppressions.xml.
  • ExecuteSqlInterpolatedAsync is obsolete in EF Core 11. The tests call ExecuteSqlAsync, which exists on both, so the net11.0 test build adds no warnings.
  • CI installs the 11.0 preview SDK next to 10.0.x in run-tests.yml, release.yml and snapshots.yml.

Eftdb.FunctionalTests stays on net10.0 only. EF Core 11's Relational.Specification.Tests moved to xUnit v3 (ValueTask fixtures, Xunit.ITestOutputHelper, no ConditionalFact), so running them on net11.0 would mean migrating that project to xUnit v3 first. That would be a separate change if you want it.

The EF Core 11 packages are 11.0.0-rc.3 for now, so dotnet pack warns NU5104 (stable package depending on a prerelease). I would bump them to 11.0.0 once it is released (expected 2026-11-10), before this is merged.

Related Issues

Closes #71

Type of Change

  • Bug fix (non-breaking change addressing an issue)
  • New feature (non-breaking change adding functionality)
  • Refactoring
  • Documentation
  • CI / build / tooling
  • Breaking change (fix or feature causing existing functionality to change)

Test Plan

  • Unit tests added/updated
  • Integration tests added/updated (Testcontainers)
  • Existing tests pass (dotnet test)

Results:

  • dotnet test --project tests/Eftdb.Tests -f net10.0: 2707 passed, 0 failed.
  • dotnet test --project tests/Eftdb.Tests -f net11.0: 2707 passed, 0 failed.
  • tests/Eftdb.FunctionalTests (net10.0): 89 passed, 0 failed.

The build has 0 errors. Its 2 warnings are both NU5104, from the rc dependency.

Checklist

  • Code follows the project's coding styles and guidelines
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • No new compiler warnings introduced
  • Public API changes have XML documentation

grzonu and others added 2 commits November 1, 2026 22:33
Both packages target net10.0 and net11.0. The net10.0 assets keep
depending on EF Core 10 and Npgsql EF 10; the net11.0 assets depend on
EF Core 11 and Npgsql EF 11. Npgsql EF 11 added IQuerySqlGeneratorFactory
to the NpgsqlMigrationsSqlGenerator constructor, so the migrations SQL
generator takes it on net11.0 only.

Relates to cmdscale#71

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the .NET 11 SDK installed next to 10.0.x, the build uses SDK
11.0.100-rc.3, which resolves a relative --project path a second time
against the project directory for multi-targeted projects. The test step
then fails with "Could not find a part of the path
.../tests/Eftdb.Tests/tests/Eftdb.Tests/Eftdb.Tests.csproj". Passing the
path under github.workspace avoids it. The working directory and the
other test arguments stay unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Nov 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

Support EF Core 11 (.NET 11): MissingMethodException in TimescaleDbMigrationsSqlGenerator

1 participant