Repository navigation
Docs: trimming and native AOT, with a recipe proven on a trimmed publish - #165
Merged
Merged
Conversation
…d-publish recipe Core is not marked trimmable and native AOT is not supported in 11.0. The Core README now says so in one section, names what ODX reads by reflection, quotes the symptoms of a trimmed type, and gives a DynamicDependency recipe. The root README links to it. Trim and AOT annotations are deferred; adding them later only adds a warning for consumers, never a break. The recipe is proven by trimmed publishes of a scratch app (Microsoft.Data.Sqlite, .NET 10, win-x64): without roots Map<T> fails at the first query, with the recipe every probe maps and matches the untrimmed run. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… root reports The measured trimmed publish reports three more ILLink warnings with the recipe's roots than without them (17 against 14); they come from rooting the provider's data reader type, and the publish and every probe still succeed. Say so in the Trimming and native AOT section. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
electricessence
marked this pull request as ready for review
November 16, 2026 20:13
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.
What this changes
Documents trimming and native AOT for 11.0. Docs only: no code, props or public API change.
Source/Core/README.md(the page nuget.org shows) gets a new "Trimming and native AOT" section: the library is not marked trimmable, native AOT is not supported in 11.0, and the section gives the recipe that makesMap<T>()work in a trimmed app, with the error you get without it.README.mdgets one paragraph with an absolute link to that section.The recipe is proven, not assumed. Five trimmed publishes of a small app on master, each with a different set of roots, run a set of probes (a class, a record,
AddParam,AddParams, a NULL into a non-nullable string, an unrooted scalar and a non-query path):Mapfails ("Value cannot be null. (Parameter 'method')"). Parameter type unrooted: onlyAddParamsfails. The README says why each root is needed.What was and was not measured, and what the README says. Measured on net10.0 (win-x64, self-contained) with Microsoft.Data.Sqlite; the README names that. A net11.0 runtime pack was not available offline, and SqlDataReader and native AOT were not run, so the README says so and tells readers to root their provider's reader type. The recipe adds three extra IL2111 trim warnings to a publish (17 against 14 with no roots); the publish and every probe still pass.
Checks
git diff --stat); no.cs,.csproj,.propsor public API file.🤖 Generated with Claude Code