NA

NativeAOT Build

Build configuration and trimming for NativeAOT

Details

Language / Topic
nativeaotNativeAOT
Category
Tooling

Rules

balanced
- Fix all AOT trimming warnings at publish time — trimmed code is silently removed.
- Use `dotnet publish -r <rid> -c Release` to test AOT builds regularly during development.
- Add `<PublishAot>true</PublishAot>` to `.csproj` — use `rd.xml` files to specify types that need runtime reflection metadata.
- Use `<TrimMode>full</TrimMode>` for smallest binaries — fix all warnings first.
- Run AOT builds in CI — they catch trimming issues that JIT builds miss.