Overview
In order to make sure that your software can cope with your ongoing business needs, you should continuously monitor its tech state. It means that you need to think about the technologies that are used not only at the stage of planning and development but also after the launch of your software. With time flow, we can observe that technologies are getting obsolete and solutions built with them are losing their capacities and starting to bring more problems than benefits.
If you have a solution created with .NET (previously known as .NET Core) some years ago or you are considering this developer platform for building your new app, we recommend you read this article as in it, we’d like to tell you about the latest version of .NET and explain what it can offer to developers.
.NET: Why do developers choose it?
The first version of the open-source cross-platform developer set of tools, libraries, and programming languages .NET by Microsoft was introduced in 2016. It became a successor to .NET Framework which was mainly used for building software for Windows devices.
.NET can be used for creating solutions of different types, including but not limited to iOS and Android mobile apps, Windows, Docker, Linux, and macOS web apps, IoT software, as well as cloud services, and independent microservices. By using it, developers can work with well-known programming languages, such as C#, f#, and Visual Basic.
Thanks to the nature of .NET, it is possible to minimize the number of programming errors, reduce the time that is typically needed for a development process, ensure compatibility of your apps with any platform, as well as achieve the best performance of your solution. Moreover, .NET apps traditionally demonstrate excellent stability and security.
But does it mean that once you build a .NET (.NET Framework) app, you can fully relax and just enjoy its benefits? Definitely not as obsolescence is a quite natural process that can’t be avoided.
Every year in November, .NET Foundation presents a new version of its developer platform. At the current moment, the newest version that is available was introduced in November 2022 and that’s .NET 7. This version will be supported for 18 months and it is claimed to be fast, modern, and simple.
What is offered in .NET 7?
While this version, as usual, has brought a portion of new features, it’s also worth mentioning that a lot of enhancements were aimed directly at improving the platform’s performance, for example, better code generation, on-stack replacement (OSR), and profile-guided optimization that is available together with OSR.
Another important update that has a strong impact on the performance is the introduction of Native AOT (Ahead-of-time), which is able to generate code not at run-time but at compile-time.
You can read more about all the performance-related improvements in the official Microsoft blog post by following the link.
As for the new features, of course, it will be absolutely impossible to name all of them. Nevertheless, we’d like to focus at least on the most interesting ones.
- Generation of X.500 names. Thanks to facilitating the process of building on `X500DistinguishedName`, .NET 7 provides a higher level of security.
- Update of the managed extensibility framework. Thanks to the new APIs, an object instance can be added to the `System.Composition.Hosting`.
- Improvements of serialization and deserialization. `System.Text.Json` is now enriched with new methods and properties which make serialization and deserialization of polymorphic type hierarchies possible and rather simple.
- RBlazor and .NET MAUI. Microsoft is continuously working on combining the possibilities of the web development framework Blazor and the mobile app development framework .NET MAUI for building a new version of them focused on native app creation.
- Cloud capacities updates. The new version makes it easier to build cloud apps. For example, it offers a simplified method of configuration and installation of the authentication system.
- Upgraded C# Hot Reload. Developers can now use it in .NET for delivering iOS and Android solutions, as well as in Blazor WebAssembly.
- Observability. Though this feature is still being developed, .NET 7 already offers positive changes in support of the OpenTelemetry cloud specification.
- Exposed method. This new feature helps to enhance performance testing. With it, it is possible to enumerate properties and get quick access to all the elements without the necessity to deal with extra allocations.
- Improved Dynamic PGO. To use Dynamic PGO which was introduced to replace the static version, there is no need to apply any optimization tools.
- A new format of command names. Developers do not have to add a — prefix to command names which was obligatory in previous versions.
- Tar APIs. .NET 7 provides cross-platform APIs for extracting and modifying ‘tar’ archives.
- App upgrading facilitation. Though developers had a lot of challenges when they wanted to migrate solutions to .NET 6, .NET 7 has significant improvements in this field thanks to .NET Upgrade Assistant.
- Microsecond and nanosecond values. The latest .NET version allows adding these values to date and time structures.
- Single and multiple memory cache. You can easily inject in both types of memory caches via calling `GetCurrentStatistics`. A single memory cache can be also instantiated with the AddMemoryCache API.
Is it worth migrating software to .NET 7?
It is obvious that when new .NET versions are introduced, some companies may start thinking about an immediate upgrade of their software solutions. Nevertheless, we always recommend not hurrying up. All migrations to a newer technology version always include a lot of serious changes in your software which means that you need to have strong grounds to do it.
Before making a final decision about the necessity and feasibility of different kinds of modernization, you need to deeply analyze the tech state of your software and consider various scenarios.