- Enable with `<PublishAot>true</PublishAot>` in csproj for ahead-of-time compilation.
- Replace reflection with source generators — use `[JsonSerializable]` for System.Text.Json serialization.
- Avoid `dynamic` keyword and `Assembly.Load()` — they are not supported in NativeAOT.
- Use `DynamicallyAccessedMembersAttribute` to annotate unavoidable reflection usage.
- Use minimal APIs instead of controllers — they avoid the reflection-heavy MVC pipeline.
- Use `IServiceCollection` dependency injection over dynamic object creation.
- Prefer compile-time configuration binding with source generators over reflection-based binding.
- Use `[LoggerMessage]` source generator for high-performance structured logging.
- Avoid `Enum.Parse<T>` in hot paths — use switch expressions or source-generated parsers.