From f567e8836c7bd25c4652a980963e584194a97582 Mon Sep 17 00:00:00 2001 From: mnbuhl Date: Sat, 25 Apr 2026 20:46:17 +0200 Subject: [PATCH 1/2] fix(build): pin EF Core major per TFM to avoid net10 binary break Consumers on .NET 10 hit MissingMethodException on IRelationalCommandBuilder.Append(string) because the provider assemblies were compiled against EF 8 (floor [8.0.0, )), where Append has a single string parameter. EF 9/10 added a second bool parameter on the interface method, so the IL emitted against EF 8 no longer resolves at runtime. Each library and test project now multi-targets net8.0/net9.0/net10.0 and pins the EF package version to the matching major via per-TFM ItemGroups (or VersionOverride for CPM-enabled test projects). The compiled assembly shipped for net{N}.0 is therefore built against EF {N}.x, matching its runtime. Pomelo.EntityFrameworkCore.MySql has no net10.0 build yet, so the MySql provider, its tests, and the benchmarks cap at net9.0. The test-mysql CI matrix is trimmed to 8.0/9.0 to match. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/ci.yml | 5 +++-- Directory.Build.props | 1 - Directory.Packages.props | 13 ++++++++++--- .../EntityFrameworkCore.Locking.Benchmarks.csproj | 9 +++++---- samples/InventoryApi/InventoryApi.csproj | 2 +- samples/QueueProcessor/QueueProcessor.csproj | 2 +- .../EntityFrameworkCore.Locking.MySql.csproj | 11 ++++++++++- .../EntityFrameworkCore.Locking.PostgreSQL.csproj | 14 +++++++++++++- .../EntityFrameworkCore.Locking.SqlServer.csproj | 14 +++++++++++++- .../EntityFrameworkCore.Locking.csproj | 13 +++++++++++-- .../EntityFrameworkCore.Locking.MySql.Tests.csproj | 2 ++ ...tyFrameworkCore.Locking.PostgreSQL.Tests.csproj | 1 + ...ityFrameworkCore.Locking.SqlServer.Tests.csproj | 1 + ...ameworkCore.Locking.Tests.Infrastructure.csproj | 2 +- .../EntityFrameworkCore.Locking.Tests.csproj | 12 +++++++++++- 15 files changed, 83 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b9ddbb..eb0d494 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,11 +60,12 @@ jobs: --logger "console;verbosity=normal" test-mysql: + # Pomelo.EntityFrameworkCore.MySql has no net10.0 build yet; MySql tests cap at net9.0. runs-on: ubuntu-latest strategy: fail-fast: false matrix: - dotnet: ['8.0.x', '9.0.x', '10.0.x'] + dotnet: ['8.0.x', '9.0.x'] steps: - uses: actions/checkout@v4 @@ -81,7 +82,7 @@ jobs: run: > dotnet test tests/EntityFrameworkCore.Locking.MySql.Tests --no-restore --configuration Release - --framework net${{ matrix.dotnet == '10.0.x' && '10.0' || matrix.dotnet == '9.0.x' && '9.0' || '8.0' }} + --framework net${{ matrix.dotnet == '9.0.x' && '9.0' || '8.0' }} --logger "console;verbosity=normal" test-sqlserver: diff --git a/Directory.Build.props b/Directory.Build.props index 16e4cdb..27466c9 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,5 @@ - net8.0;net9.0;net10.0 enable enable true diff --git a/Directory.Packages.props b/Directory.Packages.props index 38d54fb..eab17f4 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -14,11 +14,18 @@ - + + + + + - + - diff --git a/benchmarks/EntityFrameworkCore.Locking.Benchmarks/EntityFrameworkCore.Locking.Benchmarks.csproj b/benchmarks/EntityFrameworkCore.Locking.Benchmarks/EntityFrameworkCore.Locking.Benchmarks.csproj index e361b2d..6201a1e 100644 --- a/benchmarks/EntityFrameworkCore.Locking.Benchmarks/EntityFrameworkCore.Locking.Benchmarks.csproj +++ b/benchmarks/EntityFrameworkCore.Locking.Benchmarks/EntityFrameworkCore.Locking.Benchmarks.csproj @@ -1,7 +1,8 @@ Exe - net10.0 + + net9.0 false false true @@ -11,9 +12,9 @@ - - - + + + diff --git a/samples/InventoryApi/InventoryApi.csproj b/samples/InventoryApi/InventoryApi.csproj index c8f78f7..6ca2670 100644 --- a/samples/InventoryApi/InventoryApi.csproj +++ b/samples/InventoryApi/InventoryApi.csproj @@ -7,7 +7,7 @@ - + diff --git a/samples/QueueProcessor/QueueProcessor.csproj b/samples/QueueProcessor/QueueProcessor.csproj index 0251387..e410ab6 100644 --- a/samples/QueueProcessor/QueueProcessor.csproj +++ b/samples/QueueProcessor/QueueProcessor.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/EntityFrameworkCore.Locking.MySql/EntityFrameworkCore.Locking.MySql.csproj b/src/EntityFrameworkCore.Locking.MySql/EntityFrameworkCore.Locking.MySql.csproj index d5cfc77..cfb4782 100644 --- a/src/EntityFrameworkCore.Locking.MySql/EntityFrameworkCore.Locking.MySql.csproj +++ b/src/EntityFrameworkCore.Locking.MySql/EntityFrameworkCore.Locking.MySql.csproj @@ -3,10 +3,19 @@ EntityFrameworkCore.Locking.MySql MySQL (Pomelo) provider for EntityFrameworkCore.Locking. false + + net8.0;net9.0 - + + + + + + + + diff --git a/src/EntityFrameworkCore.Locking.PostgreSQL/EntityFrameworkCore.Locking.PostgreSQL.csproj b/src/EntityFrameworkCore.Locking.PostgreSQL/EntityFrameworkCore.Locking.PostgreSQL.csproj index 5a03bf0..0183966 100644 --- a/src/EntityFrameworkCore.Locking.PostgreSQL/EntityFrameworkCore.Locking.PostgreSQL.csproj +++ b/src/EntityFrameworkCore.Locking.PostgreSQL/EntityFrameworkCore.Locking.PostgreSQL.csproj @@ -3,6 +3,7 @@ EntityFrameworkCore.Locking.PostgreSQL PostgreSQL (Npgsql) provider for EntityFrameworkCore.Locking. false + net8.0;net9.0;net10.0 @@ -12,7 +13,18 @@ - + + + + + + + + + + + + diff --git a/src/EntityFrameworkCore.Locking.SqlServer/EntityFrameworkCore.Locking.SqlServer.csproj b/src/EntityFrameworkCore.Locking.SqlServer/EntityFrameworkCore.Locking.SqlServer.csproj index 168c7e0..69c6c02 100644 --- a/src/EntityFrameworkCore.Locking.SqlServer/EntityFrameworkCore.Locking.SqlServer.csproj +++ b/src/EntityFrameworkCore.Locking.SqlServer/EntityFrameworkCore.Locking.SqlServer.csproj @@ -3,10 +3,22 @@ EntityFrameworkCore.Locking.SqlServer SQL Server provider for EntityFrameworkCore.Locking. false + net8.0;net9.0;net10.0 - + + + + + + + + + + + + diff --git a/src/EntityFrameworkCore.Locking/EntityFrameworkCore.Locking.csproj b/src/EntityFrameworkCore.Locking/EntityFrameworkCore.Locking.csproj index f971789..e9007b4 100644 --- a/src/EntityFrameworkCore.Locking/EntityFrameworkCore.Locking.csproj +++ b/src/EntityFrameworkCore.Locking/EntityFrameworkCore.Locking.csproj @@ -3,6 +3,7 @@ EntityFrameworkCore.Locking Row-level locking for EF Core via ForUpdate() and ForShare() LINQ extension methods. false + net8.0;net9.0;net10.0 @@ -10,7 +11,15 @@ $(NoWarn);EF1001 - - + + + + + + + + + + diff --git a/tests/EntityFrameworkCore.Locking.MySql.Tests/EntityFrameworkCore.Locking.MySql.Tests.csproj b/tests/EntityFrameworkCore.Locking.MySql.Tests/EntityFrameworkCore.Locking.MySql.Tests.csproj index 899996f..a7b031b 100644 --- a/tests/EntityFrameworkCore.Locking.MySql.Tests/EntityFrameworkCore.Locking.MySql.Tests.csproj +++ b/tests/EntityFrameworkCore.Locking.MySql.Tests/EntityFrameworkCore.Locking.MySql.Tests.csproj @@ -1,6 +1,8 @@ $(NoWarn);EF1001 + + net8.0;net9.0 diff --git a/tests/EntityFrameworkCore.Locking.PostgreSQL.Tests/EntityFrameworkCore.Locking.PostgreSQL.Tests.csproj b/tests/EntityFrameworkCore.Locking.PostgreSQL.Tests/EntityFrameworkCore.Locking.PostgreSQL.Tests.csproj index 417ef92..15c95d4 100644 --- a/tests/EntityFrameworkCore.Locking.PostgreSQL.Tests/EntityFrameworkCore.Locking.PostgreSQL.Tests.csproj +++ b/tests/EntityFrameworkCore.Locking.PostgreSQL.Tests/EntityFrameworkCore.Locking.PostgreSQL.Tests.csproj @@ -1,6 +1,7 @@ $(NoWarn);EF1001 + net8.0;net9.0;net10.0 diff --git a/tests/EntityFrameworkCore.Locking.SqlServer.Tests/EntityFrameworkCore.Locking.SqlServer.Tests.csproj b/tests/EntityFrameworkCore.Locking.SqlServer.Tests/EntityFrameworkCore.Locking.SqlServer.Tests.csproj index 6e6466e..b0b157a 100644 --- a/tests/EntityFrameworkCore.Locking.SqlServer.Tests/EntityFrameworkCore.Locking.SqlServer.Tests.csproj +++ b/tests/EntityFrameworkCore.Locking.SqlServer.Tests/EntityFrameworkCore.Locking.SqlServer.Tests.csproj @@ -1,6 +1,7 @@ $(NoWarn);EF1001 + net8.0;net9.0;net10.0 diff --git a/tests/EntityFrameworkCore.Locking.Tests.Infrastructure/EntityFrameworkCore.Locking.Tests.Infrastructure.csproj b/tests/EntityFrameworkCore.Locking.Tests.Infrastructure/EntityFrameworkCore.Locking.Tests.Infrastructure.csproj index 5dec317..49493fb 100644 --- a/tests/EntityFrameworkCore.Locking.Tests.Infrastructure/EntityFrameworkCore.Locking.Tests.Infrastructure.csproj +++ b/tests/EntityFrameworkCore.Locking.Tests.Infrastructure/EntityFrameworkCore.Locking.Tests.Infrastructure.csproj @@ -2,11 +2,11 @@ $(NoWarn);EF1001 false + net8.0;net9.0;net10.0 - diff --git a/tests/EntityFrameworkCore.Locking.Tests/EntityFrameworkCore.Locking.Tests.csproj b/tests/EntityFrameworkCore.Locking.Tests/EntityFrameworkCore.Locking.Tests.csproj index 6ee3391..3aa534e 100644 --- a/tests/EntityFrameworkCore.Locking.Tests/EntityFrameworkCore.Locking.Tests.csproj +++ b/tests/EntityFrameworkCore.Locking.Tests/EntityFrameworkCore.Locking.Tests.csproj @@ -1,15 +1,25 @@ $(NoWarn);EF1001 + net8.0;net9.0;net10.0 - + + + + + + + + + + From e1253e7231ab9b66e15431e4455a9bdadc9b0b7e Mon Sep 17 00:00:00 2001 From: mnbuhl Date: Sat, 25 Apr 2026 20:47:52 +0200 Subject: [PATCH 2/2] fix(formatting): fixed formatting in csproj --- .../EntityFrameworkCore.Locking.SqlServer.csproj | 5 ++++- .../EntityFrameworkCore.Locking.csproj | 10 ++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/EntityFrameworkCore.Locking.SqlServer/EntityFrameworkCore.Locking.SqlServer.csproj b/src/EntityFrameworkCore.Locking.SqlServer/EntityFrameworkCore.Locking.SqlServer.csproj index 69c6c02..e09da53 100644 --- a/src/EntityFrameworkCore.Locking.SqlServer/EntityFrameworkCore.Locking.SqlServer.csproj +++ b/src/EntityFrameworkCore.Locking.SqlServer/EntityFrameworkCore.Locking.SqlServer.csproj @@ -19,6 +19,9 @@ - + diff --git a/src/EntityFrameworkCore.Locking/EntityFrameworkCore.Locking.csproj b/src/EntityFrameworkCore.Locking/EntityFrameworkCore.Locking.csproj index e9007b4..ba61457 100644 --- a/src/EntityFrameworkCore.Locking/EntityFrameworkCore.Locking.csproj +++ b/src/EntityFrameworkCore.Locking/EntityFrameworkCore.Locking.csproj @@ -16,10 +16,16 @@ - + - +