Using the configuration-binding source generator
.NET 8 introduces a configuration-binding source generator that provides an alternative to the default reflection-based implementation. In simple terms, the name of the options class properties and the settings keys are now hard-coded, accelerating the configuration retrieval.
Beware: the settings keys are case-sensitive and map one-on-one with the C# class property name, unlike the non-generated code.
Web applications using native AOT deployment (ahead-of-time compilation to native code) or trimming self-contained deployments to ship only the bits in use now leverage this option by default.
The native AOT deployment model compiles the code to a single runtime environment like Windows x64. It does not need the just-in-time (JIT) compiler since the code is already compiled to the native version of the targeted environment. AOT deployments are self-contained and do not need the .NET runtime to work.
...