Repository navigation
11.0.0-preview.1: retarget main to net11.0 / EF Core 11 / Npgsql 11 after the v10.0.0 tag, with the four behaviour changes as named tests #103
Description
Scope since 2026-10-18: this is 11.0.0-preview.1, the retarget itself, under the 11.0.0 epic #147.
- On
main, right afterrelease/10.xis cut at thev10.0.0tag (Tag-time branch steps assume a net11 branch that was never created #280), a PR carrying only:net11.0in the four csproj files, EF 11 RC2 and Npgsql EF 11 RC references,#ifaround the two EF1001 usages if their shapes moved, PostgreSQL floor 16 in the docs. - Public API identical to 10.0.0; the ApiCompat baseline is 10.0.0 and the pack must be clean.
- The four behaviour changes below become named tests, run in the integration suite against PostgreSQL 16 and 18 (CI matrix for two lines: .NET 10 and 11 SDKs, PostgreSQL floor and 18 legs per line #152).
- The release workflow publishes
11.0.0-preview.1frommain(prerelease path,--latest=false, Two supported lines: policy, branch rules, SECURITY rows, and the silent-fix rule as a minor with a changed-answers section #151); one preview per .NET 11 RC while the line is open. - The consumer smoke test runs with the .NET 11 SDK, including the NativeAOT consumer.
- Core TFM on the 11 line: decide here. The Compile probe: C# 15 closed hierarchies and union types for the five variants, on net10.0 and net11.0 #148 probe showed
closedneeds no runtime support and anet11.0consumer compiles fine against anet10.0asset, so the core and NodaTime packages of the 11 line may keepnet10.0for reach, with only the two EF packages onnet11.0. Trade-off: reach for .NET 10 consumers of the 11.x core (who could use 10.x anyway) versus one TFM per line and a simpler story. Recommendation:net11.0on all four, one TFM per line, as every sampled EF plugin does; record the choice in the changelog's platform-floor line.
Raising the runtime floor of the released 10.x line is not on the table: 10.x stays on .NET 10 for its whole life.
Two couplings found on 2026-10-18 after #158/#159:
- ComplexIndexes. The integration project and the fourth smoke consumer reference
EFCore.ComplexIndexes.PostgreSQL5.4.0, which pinsNpgsql.EntityFrameworkCore.PostgreSQLto[10.0.0, 11.0.0). On the 11 line that restore fails. So the retarget either waits for ComplexIndexes'11.0.0-preview.1(its issue Adopt the plain-docs voice and rewrite the consumer docs in it #38, which should go first) or conditionsComplexIndexesCrossTestsand the fourth consumer onnet10.0with a comment naming Adopt the plain-docs voice and rewrite the consumer docs in it #38, and ComplexIndexes Support compiled models generated with --nativeaot #42 restores them on the 11 line. Prefer the first.
The four measured behaviour changes (original analysis, 2026-10-17)
EF Core 11 (11.0.0-rc.2.26504.105), .NET 11 RC2 and the Npgsql EF provider 11.0.0-rc.1.1 are published; EF 11 needs the .NET 11 runtime, so the move is a retarget, not a bump. A source diff of dotnet/efcore release/10.0 (a5e42cd) against release/11.0 (c8a9187, 2026-10-16) on the query and storage paths shows every interface this package implements unchanged: IRelationalParameterBasedSqlProcessorFactory, RelationalParameterBasedSqlProcessor.Process(Expression, ParametersCacheDecorator), IRelationalTypeMappingSourcePlugin, IMethodCallTranslatorPlugin, IMemberTranslatorPlugin, IAggregateMethodCallTranslatorPlugin, IQueryExpressionInterceptor, RelationalTypeMapping.Clone. The two EF1001 usages (PgBinaryExpression in ValueSetSqlGuard, PgNewArrayExpression in ValueSetsMethodCallTranslator) are Npgsql-internal, and the Npgsql 11 provider's notes list no query-tree changes; the NodaTime satellite's EF1001 pragmas are only the analyzer reading this package's own .Internal namespace.
Four things do change under the package and need a measured answer before 10.x targets EF 11 (none is a compile error):
JsonValueReaderWriter<T>.ToJsonthrowsArgumentNullExceptiononnullunless the new virtualHandlesNullWritesreturns true.LiteralJsonValueReaderWriter<T>and the threeYearMonth*writers override onlyToJsonTyped. Whether EF 11 reachesToJsonwithnullfor a nullable range or set property inside aToJson()complex type (the "null and empty, kept apart" row indocs/efcore.md) must be tested; if it does,HandlesNullWritesand anullbranch are the fix.RuntimeConstantExpression(experimental, precompiled queries) is a new node that reduces to aConstantExpression.RangeVariantConstantRetyperinValueRangesQueryExpressionInterceptorrelies on EF inliningConstant(value, Int32Range.Finite)and overridesVisitConstant. Whether the new node can carry a variant-typed range past the retyper is the one item that could change an answer;InlineRangeConstantTestsand the integration suite decide it.SqlExpressionFactorysimplifiesa == b ? null : atoNULLIF(a, b).ValueSetSqlGuardjudges the final tree; aNULLIFover anarray_cat-derived value is a new shape it has no arm for and must refuse (equality) rather than pass. Seed it.- Npgsql EF 11 raises the default PostgreSQL compatibility target from 14 to 16. Nothing this package emits is version-gated today; confirm
timerangeand multirange SQL are unaffected.
Also noted: EF 11 removes ITypeMappingSource.FindMapping(MemberInfo) and CoreTypeMapping.ValueGeneratorFactory (not used here), adds RelationalTypeMapping.GetDefaultProviderValue() (not overridden here; check whether the range and set mappings should), and Property(…) no longer configures primitive collections (value sets are not IEnumerable<T>, so inert). Npgsql 11 core is not on NuGet yet; its range, multirange, array and infinity behaviour is unverified.
Proposed: a CI job (allowed to fail until GA) that builds the four packages and runs the EF translation and integration suites against EF 11 RC + Npgsql EF 11 RC on net11.0, with the four items above as named tests; then the retarget PR for 10.x, with docs/migration.md saying what the consumer must do.
Sources: https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-11.0/breaking-changes ; https://www.npgsql.org/efcore/release-notes/11.0.html ; https://npgsql.org/doc/release-notes/11.0.html ; https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-11/overview
Found by the platform-horizon review, 2026-10-17.
Activity
CaffeinatedCoder commentedon Oct 18, 2026
Scope widened 2026-10-18, now under the 11.0.0 epic #147.
This issue is
11.0.0-preview.1: the retarget itself, not only the measurement.net11on top ofmain, carrying only:net11.0in the four csproj files, EF 11 RC2 and Npgsql EF 11 RC references,#ifaround the two EF1001 usages if their shapes moved, PostgreSQL floor 16 in the docs. It mergesmainforward after every 10.0.0 fix; it never receives a fix first.11.0.0-preview.1from the branch (prerelease path,--latest=false); one preview per .NET 11 RC while the line is open.[-]Prepare 10.x for EF Core 11 / Npgsql 11 / .NET 11: measure the four behaviour changes under the plugin[/-][+]11.0.0-preview.1: retarget to net11.0 / EF Core 11 / Npgsql 11 on the net11 branch, with the four behaviour changes as named tests[/+]CaffeinatedCoder commentedon Oct 18, 2026
Measured in ComplexIndexes' retarget (its draft PR #47, 2026-10-18):
Npgsql.EntityFrameworkCore.PostgreSQL11.0.0-rc.1.1 pinsMicrosoft.EntityFrameworkCore.Relationalexactly, so anet11branch that references it sits on EF Core 11 RC1, not RC2, until Npgsql publishes an RC2 build. Reference the EF packages at the version Npgsql pins rather than fighting NU1107. Also: package validation cannot compare anet11.0asset against anet10.0baseline (ComplexIndexes #46, the twin of #157), so the ApiCompat gate onnet11needsPackageValidationBaselineFrameworkReferencesor an explicit statement that the 11 line's first comparable baseline is11.0.0itself.[-]11.0.0-preview.1: retarget to net11.0 / EF Core 11 / Npgsql 11 on the net11 branch, with the four behaviour changes as named tests[/-][+]11.0.0-preview.1: retarget main to net11.0 / EF Core 11 / Npgsql 11 after the v10.0.0 tag, with the four behaviour changes as named tests[/+]CaffeinatedCoder commentedon Oct 19, 2026
Retarget done on
mainfor11.0.0-preview.1(PR to follow). What the four measured items turned out to be, each now a named test inEfCore11RetargetTests(integration, runs on 16 and 18) and the two translation-level ones inEfCore11ShapeTests:HandlesNullWrites— EF Core 11 writes a null property as JSONnullwithout calling the plugin's writers (all reportHandlesNullWrites == false); the document holds"MaybeTags": nulland reads back as null, for the complex and the owned path. No change needed.RuntimeConstantExpression— created in shaper processing and precompiled-query generation, after translation; the interceptor runs atQueryCompilationStarting, so the inlined variant constant still arrives as aConstantExpressionand the retyper handles it. No change needed.NULLIF— EF Core 11 does writea == b ? null : aasNULLIF(a, b). The guard'sCASEarm no longer saw the equality; aNULLIFarm refuses it as equality (proved by revert: without it the refusal was the generic "This use of it").timerangeand multirange SQL is byte-identical underSetPostgresVersion(14)and runs on the live server.Core TFM decision:
net11.0on all four packages, one TFM per line, recorded in the changelog's platform line.Package validation: as predicted, a
net11.0asset cannot be paired with thenet10.0baseline (PKV006, no member comparison).Directory.Build.propsignores the baseline's framework with the statement, and adotnet apicompatrun over the four 10.0.0 assemblies against this build reports no breaking changes; the mechanical gate returns when 11.0.0 is the baseline (CONTRIBUTING says so).ComplexIndexes: no 11 preview on NuGet (5.4.1 still pins
[10.0.0, 11.0.0), its #38 open), soComplexIndexesCrossTestsand the fourth smoke consumer are conditioned onnet10.0as described here; CaffeinatedCoder/EFCore.ComplexIndexes#42 turns them back on.Not predicted, found by the first test run (each its own issue, fixed in the same PR): #286 (.NET 11 reads hour 24), #287 (EF Core 11 rewrites
RangeSet.Contains, with #288 for the 10.x line), #289 (jsonb_set_lax), #290 (empty captured collection as a bareNULL), #291 (Native AOT trap in the set types' defaultIFormattable.ToStringunder ILCompiler 11 RC2).