dotnet-trimming
Installation
SKILL.md
dotnet-trimming
Trim-safe development for .NET 8+ applications and libraries: trimming annotations ([RequiresUnreferencedCode], [DynamicallyAccessedMembers], [DynamicDependency]), ILLink descriptor XML for type preservation, TrimmerSingleWarn for granular diagnostics, testing trimmed output, fixing IL2xxx/IL3xxx warnings, and library authoring with IsTrimmable.
Version assumptions: .NET 8.0+ baseline. Trimming shipped in .NET 6, but .NET 8 provides the most complete annotation surface and analyzer coverage. .NET 9 improved warning accuracy and library compat.
Scope
- MSBuild properties for trimming (apps vs libraries)
- Trimming annotations (RequiresUnreferencedCode, DynamicallyAccessedMembers, DynamicDependency)
- ILLink descriptor XML for type preservation
- TrimmerSingleWarn for granular diagnostics
- IL2xxx/IL3xxx warning reference and fixes
- Testing trimmed output and CI gates
- Library authoring with IsTrimmable and IsAotCompatible