Repository navigation
Enable EnablePreviewFeatures and runtime-async=on across the repo - #38442
Merged
AndriySvyryd merged 2 commits intoJun 17, 2026
Merged
Conversation
… latest TFM Co-authored-by: AndriySvyryd <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enables .NET preview compilation features needed to turn on the runtime-async=on compiler feature across the repository (scoped to the repo’s latest TFM), and ensures the Features property is composed rather than overwritten under src/.
Changes:
- Enable
EnablePreviewFeaturesand appendruntime-async=ontoFeaturesfor$(DefaultNetCoreTargetFramework). - Preserve inherited
$(Features)insrc/Directory.Build.propswhen addingnullablePublicOnly;strict.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Directory.Build.props | Conditionally enables preview features and runtime-async=on for the default/current TFM. |
| src/Directory.Build.props | Preserves inherited Features while adding nullablePublicOnly;strict under src/. |
…tions Co-authored-by: AndriySvyryd <[email protected]>
AndriySvyryd
marked this pull request as ready for review
June 17, 2026 21:23
AndriySvyryd
enabled auto-merge (squash)
June 17, 2026 21:23
wtgodbe
approved these changes
Jun 17, 2026
wtgodbe
left a comment
Member
There was a problem hiding this comment.
I think this is safe given everything ships as a package only
AndriySvyryd
deleted the
copilot/enable-preview-features-for-all-projects
branch
June 17, 2026 21:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Turn on the .NET 11
runtime-asynccompiler feature (and the prerequisiteEnablePreviewFeatures) for every project, letting the runtime emitawaitcontinuations directly instead of compiler-generated state machines.Changes
Directory.Build.props— set both properties, scoped to$(DefaultNetCoreTargetFramework):TFM scoping is required because the older-TFM legs of
Microsoft.Data.Sqlite.Core,EFCore.Tasks, andef(net10.0/netstandard2.0) fail with CA2252 + SYSLIB5007 —EnablePreviewFeaturesonly suppresses those onIsNetCoreAppTargetingLatestTFM, and runtime-async lowersawaittoAsyncHelpers.Await, which is still preview onnet10.0.src/Directory.Build.props— prepend$(Features);so the inherited list is preserved instead of being overwritten:Without this, every
src/project silently droppedruntime-async=on.Findings
Full unit-test pass on the runtime solution (~12.5K tests). The 6 pre-existing
EFCore.Design.TestsLinux/SQL failures are unchanged.Shipping NuGet sizes, baseline vs modified (built from
EFCore.Runtime.slnf):Abstractions/Analyzersare unchanged (non-latest TFM, no async).Design/Proxies/HierarchyId/NTSmove by +0.02–0.08% — the[RequiresPreviewFeatures]assembly attribute outweighing minimal async savings in those projects.IL-level view of
Microsoft.EntityFrameworkCore.dll:[AsyncStateMachine]attributesThe 29 remaining state machines are async iterators and other forms not covered by runtime-async.
Benchmarks were not run — EF's BDN suite needs a live DB and a meaningful A/B takes hours; this should go through the standard benchmarking pipeline. Given zero compiler state machines remain for
Task/ValueTaskasync methods, expect modest throughput gains and reduced GC pressure on async-heavy paths (SaveChangesAsync, async query enumeration,FirstAsync/SingleAsync).