Native AOT Advances in .NET 8 Preview 6

.NET 8, now four months away from GA, continues to advance native ahead-of-time compilation (native AOT) functionality in the new Preview 6.

Native AOT (or NativeAOT) is a focus point of the .NET 8 dev team. It was introduced in .NET 7 a couple years after its absence from predecessor .NET Core was identified in a survey as holding back adoption of the development platform.

Does the lack of officially supported native AOT option prevent you from using .NET more?
[Click on image for larger view.] "Does the lack of officially supported native AOT option prevent you from using .NET more?" (source: Microsoft).

Though it comes with some trade-offs, it provides several benefits including faster startup time and smaller memory footprints, along with enabling apps to run on machines that don't have the .NET runtime installed.

[Click on image for larger view.] Native AOT in .NET 8 (source: Microsoft).

Those machines might run iOS, and Preview 6 introduces an opt-in feature to enable support for targeting iOS-like platforms.

"This includes building and running .NET iOS and .NET MAUI applications with NativeAOT on: ios, iossimulator, maccatalyst, tvos or tvossimulator systems," Microsoft said in a July 11 post announcing Preview 6. "The motivation of this work is to enable users to explore the possibility of achieving better performance and size savings when targeting such platforms with NativeAOT."

This opt-in feature targets app deployment, and Mono is still the default runtime choice for app development and deployment. Microsoft cited some found improvements (30-40 percent reduction in app sizes compared to Mono) in the post and provided guidance on how to build and run a .NET MAUI application with Native AOT on an iOS device with .NET CLI (command-line interface).

While perhaps not a major feature, the above stands out in a preview that Microsoft described as "a continuation" of the previous preview. The company specifically highlighted library updates, a new WASM mode, more source generators and constant performance improvements along with Native AOT support on iOS.

Microsoft also noted the preview of a .NET MAUI extension for Visual Studio Code, allowing for cross-platform development with Microsoft's evolution of Xamarin.Forms, such evolution including the addition of the desktop as an app target in addition to traditional iOS and Android mobile targets.

.NET MAUI (or NET Multi-platform App UI ) warranted its own announcement, which noted the dev team resolved 23 high-impact issues. That announcement also noted that developers can try out .NET 8 with the 17.6.1 release of Visual Studio for Mac.

On the web-dev side of things in the ASP.NET Core component, Microsoft bolstered new Blazor rendering schemes.

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus


Subscribe on YouTube