Microsoft has introduced the release of the open platform .NET 11, created through the unification of .NET Framework, .NET Core, and Mono products. Based on .NET 11, developers can create cross-platform applications for browsers, cloud systems, desktops, IoT devices, and mobile platforms using unified libraries and a common build process, irrespective of the application type. .NET SDK 11, .NET Runtime 11, and ASP.NET Core Runtime 11 builds are formed for Linux, macOS, and Windows, with .NET Desktop Runtime 11 available only for Windows. Related project developments are distributed under the MIT license.
.NET includes a Runtime with the RyuJIT JIT compiler, API specifications, WPF, Windows Forms, WinUI, and Entity Framework libraries, as well as a command-line interface.
dotnet, along with tools for developing microservices, libraries, server-side, graphical, and console applications. Separately, the stack for developing web applications ASP.NET Core 11.0, ORM layer Entity Framework Core 11.0 (drivers available for SQLite and PostgreSQL, among others), WPF library 11 (Windows Presentation Foundation), Windows Forms 11 framework for GUI development, Aspire 11 platform for creating Cloud Native applications, and MAUI 11 framework for developing cross-platform user interfaces, as well as releases for C# 15 and F# 11. Support for .NET 11.0 and C# 15 is included in the free code editor Visual Studio Code.
Features of the new release:
- The C# 15 language has introduced the union keyword for declaring a type that can only hold one of a predefined set of variant types. A union type variable can be assigned values from any of the permitted types, and an error will be thrown by the compiler if an attempt is made to assign a value of a type not specified during declaration.
public record class Cat(string Name);
public record class Dog(string Name);
public record class Bird(string Name);public union Pet(Cat, Dog, Bird);
A ‘closed’ modifier is proposed for classes, which allows for the creation of closed hierarchies where inheritance from a base class with the closed modifier is allowed only within the same assembly where it is declared, and the complete set of direct descendants is known at compile time. Union types and closed hierarchies ensure that all possible variants are handled in switch constructs, eliminating the need for a 'default' branch and a '_' variable.
The new version of C# also adds support for transitioning from 'break' and 'continue' statements to designated labels, and expands experimental capabilities for isolation in unsafe code blocks that directly interact with memory (the ability to use unsafe for individual expressions has been added).
- In F# 11, memory consumption by the compiler has been reduced and the number of memory allocation operations when working with collections from FSharp.Core has been decreased. The capability to limit concurrently running asynchronous tasks to prevent overload has been added. Preliminary support for Runtime Async has been introduced.
- The SDK is enabled by default server MSBuild and the precompiled (NativeAOT) version of the dotnet CLI toolset.
The size of SDK installers for Linux and macOS has been reduced through assembly deduplication. - The JIT compiler has been optimized by removing redundant boundary checks and branches, improving devirtualization, and expanding constant folding operations. A common call handler has been implemented in the AOT compiler, reducing code volume and increasing throughput during intensive interface calls. For Linux and macOS, stack trace and module information save on crash has been implemented.
- An experimental Runtime Async mechanism has been added to replace the code generated by the compiler for async operation handling with an implementation that manages the suspension and resumption of asynchronous operations at the runtime level.
- A template has been added to the SDK server MCP for integration with AI tools and services. For applications using AI services, a set of abstractions Microsoft.Extensions.AI (MEAI) has been added. Based on these abstractions, the
Microsoft Agent Framework (MAF) has been created, which can be used for developing AI agents. - In the Process API, capabilities for launching processes with interception of their output and exit codes, as well as control over inherited descriptors, have been expanded.
- In the System.IO.Compression API, support for the Zstandard compression algorithm has been added.
- New stream adapters ReadOnlyMemoryStream, WritableMemoryStream, ReadOnlySequenceStream, and StringStream have been added.
- The dotnetup utility has been introduced for installing and updating the SDK and runtime.
Source: opennet.ru
