Showing posts with label aot. Show all posts
Showing posts with label aot. Show all posts

Monday, 9 February 2026

What is Ready to Run (R2R) Compilation in Visual Studio?

Ready-to-run compilation is a feature in .NET that improves startup performance by compiling them in Ready-to-run format. This is a form of AOT (ahead-of-time) compilation that reduces work for the JIT compiler as the application loads. Your binary contains IL and precompiled IL. It only works if you target specific environments such as Linux x64 or Windows x64.

Enable Native AOT Publish

Native AOT (Ahead-of-time) deployment compiles your app to native code avoiding the need for a runtime. Compilation takes longer but the app runs faster, and with lower memory usage. Debugging may be more complicated relative to regular .NET applications.

The Solution Explorer project file contains the essential code required for this.

<PublishAot>true</PublishAot>

More details on AOT deployment here.