It has been a busy week for the .NET Team over at Microsoft. Not only are we getting Entity Framework 7 Preview 3, but now .NET 7 Preview 3 is hitting the shelves as well. It comes with some very much awaited features that we'll dig into in a bit. Let's get to it!
In a nutshell, Ahead of Time ( AOT ) Compilation builds everything upfront, to avoid needing to "JIT" when an app runs for the first time. For quite some time the team has been working tirelessly to bring proper Native Ahead-of-Time compilation to dotnet. While partial AOT has always been present, full "true" support was never there out of the box.
Jon Douglas Senior Program Manager from Microsoft gives us a bit of insight into what's different.
Native AOT is similar to .NET’s existing AOT technologies, but it produces only native artifacts. In fact, the Native AOT runtime does not know how to read the .NET assembly file formats – everything is platform-native. The executable file format parsing is fully handled by the underlying operating system.
For more information on how Native AOT works and how to get started check out the official docs.
We were told .NET 7 would focus on performance. With Preview 3 the team has been able to realize an improvement of ~15% to startup times with Write-Xor-Execute enabled. The change has improved performance even when Write-Xor-Execute is disabled, however the team found some regression problem which will be addressed in an upcoming release.
Upgrading from .NET 6
As we've discussed before, upgrading from .NET 6 to 7 should be straightforward and the chances of things breaking are slim, however not impossible.
- Head over to the official download site and download the .NET SDK.
- To be on the safe side also check out the list of breaking changes here.
Make sure you have a backup of your project before going forward, then open your project file and modify the target framework property.
For more information on this latest release check out the official post from Microsoft. It also contains some very interesting information on roadmap items. Have you been tinkering with .NET 7 already? How has it worked out for you? Let us know in the comments below.