aot-trimming
Installation
SKILL.md
.NET Trimming and Native AOT
When to Use
- Adding trimming (
PublishTrimmed) or Native AOT (PublishAot) support to a library or application - Resolving
IL2xxx(trimming) andIL3xxx(AOT/single-file) warnings - Making reflection-heavy code trimming-safe
- Replacing runtime reflection, assembly scanning, or
Reflection.Emitwith compile-time alternatives - Reviewing a codebase or PR for trimming/AOT compatibility, including generated interceptors and analyzer suppressors
- Designing public APIs that must carry trimming annotations
Core Goals
- Produce code that survives the linker's reachability analysis and runs under Native AOT (no JIT).
- Express what the compiler cannot see — which members reflection needs — using the trimming attributes.
- Keep trimming-safe and trimming-unsafe code separated so unsafe paths are explicit and contained.