We researched that we can switch to Native AOT in our projects. And we decided that it does not satisfy our needs at the moment. You can see the research notes below.
You need to enable PublishAot
to use it. Then when we publish, the project
will be compiled with AOT. The target platform is important when publishing
because it only works on that platform. For more detail.
AOT compiler might miss some types if the application uses reflection, you can
add an rd.xml
file to help ILCompiler
find the types that should be
analyzed. For more detail.
Native AOT does not support the json serializers, dynamic
type, object
relational mapping libraries, MVC
etc. that we use, so we do not prefer it for
now.