News

.NET Community Toolkit Gets Native AOT and .NET 8 Support

The .NET Community Toolkit is Microsoft's latest dev tooling to get native ahead-of-time compilation, continuing a years-long push for that capability across the board.

Native AOT (sometimes NativeAOT at Microsoft) has been a focus point since a survey years ago indicated 35 percent of developers would like to write more .NET projects but couldn't due to no Native AOT option, while 17 percent said its absence made them rewrite projects.

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).

The company says Native AOT apps provide these benefits:

  • Minimized disk footprint: When publishing using Native AOT, a single executable is produced containing just the code from external dependencies that is needed to support the program. Reduced executable size can lead to:
    • Smaller container images, for example in containerized deployment scenarios.
    • Reduced deployment time from smaller images.
  • Reduced startup time: Native AOT applications can show reduced start-up times, which means:
    • The app is ready to service requests quicker.
    • Improved deployment where container orchestrators need to manage transition from one version of the app to another.
  • Reduced memory demand: Native AOT apps can have reduced memory demands, depending on the work done by the app. Reduced memory consumption can lead to greater deployment density and improved scalability.

Now, it has been rolled out in the kit, a collection of helpers and APIs designed to simplify common development tasks for all .NET developers, regardless of the specific UI platform they are using, sporting libraries labled Common, Mvvm, Diagnostics and HighPerformance. The toolkit, part of the .NET Foundation, is maintained and published by Microsoft.

"The main change in this new release of the .NET Community Toolkit is support for .NET 8 and NativeAOT!," said Microsoft's Sergio Pedri, lead developer on the project. "As part of this, all APIs across all packages have been annotated to fully support trimming and AOT compatibility, to ensure using any part of the .NET Community Toolkit goes smoothly even in those scenarios."

Other changes were announced for individual components, including a performance boost for the MVVM Toolkit, which Pedri explained: "This time, the focus was on making the support for INotifyPropertyChanging fully pay-for-play: meaning that when this interface is not needed, there will be no additional overhead because of it. For instance, frameworks such as UWP and WinUI 3 don't need viewmodels to implement this property," he said, going on to explain how to change a setting for those scenarios.

.NET Community Toolkit Changelog
[Click on image for larger view.] .NET Community Toolkit Changelog (source: Microsoft).

All the details are available in the announcement post and GitHub-hosted and above-pictured changelog.

Four new community contributors received shout-outs.

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus

Featured

Subscribe on YouTube