Production-ready version of .NET 9.0 now available on download page Available for free. For .NET 9.0, developers need Development Environment Visual Studio 2022 At least version 17.12, which is also considered production ready.
Advertisement
While version 8.0, released in November 2023, received a total of 36 months of long-term support (LTS) and will therefore continue to receive updates until November 2026, Microsoft provides updates and technical support for .NET 9.0 as standard term support (STS). Is. ) only for a period of 18 months, i.e. till May 2026.
Entity Framework Core 9.0 also runs on .NET 8.0
The structure of .NET 9.0 is similar to that of .NET 8.0 (see Figure 1): a variety of applications run on a common software development kit (SDK), a common base class library, based on C#, F#, and Visual Basic. .NET languages as well as the object-relational mapper Entity Framework Core which can be used in (almost) all types of applications. Unlike the previous version, the current Entity Framework Core version 9.0 works not only with the current .NET version 9.0, but also with its predecessor, .NET 8.0. Two different runtimes continue to operate underground, depending on the type of application and operating system: the .NET Core runtime and the Mono runtime.
Structure of .NET 9.0 (Figure 1)
(Image: Dr. Holger Schweitenberg)
again many breaking changes
Those switching to .NET 9.0 from older .NET versions need to set the target framework not only in the project file or the central build configuration file directory.build.props. net9.0
Make changes, but also keep in mind the many destructive changes. Breaking changes compared to .NET 8.0 Microsoft documents in tables,
(Image: Dmytro Vikarchuk/Shutterstock))
In Online Conference BetterCode() .NET 9.0 On November 19, 2024 by iX and dpunkt.verlag, .NET experts from www.IT-Visions.de will present the finished version of .NET 9.0 using practical examples. These include innovations in the .NET 9.0 SDK, C# 13.0, ASP.NET Core 9.0, Blazor 9.0, Windows Forms 9.0, WPF 9.0, WinUI, .NET MAUI 9.0, and the integration of artificial intelligence in .NET applications. Program Offers six lectures, one discussion and six workshops.
have tickets through ticket shop Available on the conference website.
A serious change is the abolition of class BinaryFormatter
This is because security flaws in this type of serialization have been known since 2012 (2012 Black Hat Conference). Microsoft has its own BinaryFormatter Migration Guide Published in which the company recommends migrating to other serialization formats such as XML, Message Pack, and Protobuf. Developers who do not want to transfer their program code to other serialization formats can use NuGet packages system.runtime.serialization.formatters Integrate and continue using binary numbering. You also need to set this in the project file:
true
There are separate lists of significant changes for Entity Framework Core and C#:
.NET 9.0 runs faster
Microsoft has again (as in previous .NET versions) included several performance improvements in .NET 9.0, for example:
- fast runtime errors
- Improved inlining for generic methods
- Optimizing loops in JIT
- Optimization in profile-guided optimization (PGO)
- Significant reduction in memory requirements in the garbage collector in server mode
- Improvements in execution time and memory allocation for many .NET base classes.
Explanation of performance improvements and exact statistics can be found in a very long document On Microsoft DevBlogs,
Microsoft is particularly proud of saving storage space with ASP.NET Core Minimal WebAPI (see Figure 2).
Performance and storage improvements in ASP.NET Core Minimal WebAPI (Figure 2)
(Picture: Microsoft DevBlogs,
lots of new features
.NET 9.0 has many new features in all areas: C# programming language, base class library, object-relational mapping with Entity Framework Core, JSON serialization with System.Text.Json, ASP.NET Core and Blazor Web Framework as well. Cross-platform UI .NET MAUI. Individual improvements have also been made to the older Windows desktop framework Windows Forms.
heise developers report on innovations in .NET 9.0 based on the preview and release candidate versions:
Compared to the functions mentioned in the above articles, the following points have been added to the RTM version (release to manufacturing):
- System.Text.Json now includes mandatory constructor parameters, flexibility in the positioning of type metadata (
$type
), reading multi-JSON documents and optimizing the serialization of enumeration member names. There is a way to do this tooDeepEquals()
in classJsonElement
, - The long-standing Windows Forms control
FolderBrowserDialog
Allows multiple selection of files in .NET 9.0. -
Control
The control from which Windows Forms and all controls in the form are derived has a methodInvokeAsync()
For easy execution of asynchronous tasks. - The .NET Multi-Platform App UI (.NET MAUI) provides compiled data binding that is fast and also works with NativeAOT compilation.
- MAUI Control owns one
TimeSelected
-Event that fires when the selected time changes.
The result of Microsoft’s work on AOT compatibility of Entity Framework Core is disappointing. Entity Framework Core is only a first small step towards AOT compilation in 9.0: only static LINQ queries can be precompiled at development time. To do this, Microsoft uses static code analysis and C# interceptors. Microsoft itself says this: “We encourage you to experiment with current support and report on your experiences, but advise against deploying EF NativeAOT applications in production.”
New AI Library Microsoft.Extensions.AI
With the release of .NET 9.0, Microsoft A new AI library Announced for .NET. The new NuGet package Microsoft.Extensions.AI allows .NET developers to simplify the use of various AI services such as OpenAI, Azure AI, Ollama, and GitHub. The community can contribute its own models (see Figure 3).
New AI library for .NET (Figure 3)
(Picture: Microsoft DevBlogs,
Developers should not commit to a specific provider by using a specific library for a specific AI service. Microsoft encourages AI library authors to provide interfaces, such as IChatClient and IEmbeddingGenerator, defined in the Microsoft.Extensions.AI.Abstractions package. The Microsoft.Extensions.AI library and Microsoft packages based on it such as Microsoft.Extensions.AI.AzureAIInference, Microsoft.Extensions.AI.OpenAI and Microsoft.Extensions.AI.Ollama already offer implementations for these interfaces.
Microsoft has numerous on GitHub example ready,
(MDO)