网页 综合 更新时间 2026-11-10 16:11:00

Announcing .NET 11 - .NET Blog

自动蜘蛛 devblogs.microsoft.com 正文约 5999 字
Announcing .NET 11 - .NET Blog
Today, we’re excited to announce the release of .NET 11! This year’s release makes building modern applications faster, more productive, and has improvements across C# 15, ASP.NET Core, .NET MAUI, and Windows development. With hundreds of runtime optimizations, more responsive SDK tooling, and less overhead in everyday commands, you can spend less time waiting and more time creating. Build richer web and cross-platform applications, take advantage of new C# language features, and explore AI-powered development with improved tools and agentic capabilities.
Explore .NET 11 with the product teams and community at .NET Conf 2026. The conference includes product team sessions on November 10 and 11, followed by two days of community sessions.
Watch the Day 1 livestream, including the keynote, or browse the conference session playlist.
Some of the changes we’re most excited for you to try:
The what’s new in .NET 11 overview links to the full details. Here are the changes behind those headlines and how to start using them.
C# 15 is the default language version for projects targeting .NET 11. Union types are one of its biggest additions: a value can be one of a declared set of case types, with conversions from those types and exhaustiveness checking in switch expressions.
Consider a product lookup that either finds a product or reports that it wasn’t found:
The result type tells a caller which outcomes it needs to handle. There’s no need to use object or an unrelated base class just to put those outcomes behind one return type.
C# 15 also adds closed hierarchies. A closed class limits direct derivation to its declaring assembly, giving the compiler the information it needs to check patterns over the hierarchy. Unions are useful when you want to combine existing types; closed hierarchies fit models where you own the inheritance relationship.
Smaller language features help with everyday code, too. Collection expression arguments let you pass constructor or factory arguments without giving up collection expression syntax:
This prints 2: the comparer controls equality, so "Alice" and "ALICE" are one entry.
Other additions include extension indexers and labeled break and continue. These features don’t require the preview language version. The separate memory safety work remains in preview; see the C# 15 feature documentation for its opt-in requirements.
F# 11 improves compiler memory use and reduces allocations in FSharp.Core collection operations. It also adds ways to bound concurrent asynchronous work, useful when a collection operation would otherwise start more work than a service or machine can handle comfortably.
The F# release notes distinguish the default-language updates from preview capabilities, including Runtime Async support for custom computation-expression builders.
The SDK now enables a Native AOT CLI host by default. Commands such as help and version queries can run without starting the managed CLI, and tool launches can avoid that startup path too. Commands that need managed execution still use it.
The MSBuild server also stays warm between CLI invocations by default, reducing repeated startup work. SDK installers on Linux and macOS are smaller through assembly deduplication.
File-based apps can grow across source files with #:include, and solution filters can be created and edited from the CLI. dotnet watch adds Aspire app-host integration, crash recovery, and device selection for mobile projects.
For teams using Microsoft.Testing.Platform, dotnet test gains run-level timeouts, failure limits, clearer progress reporting, and per-module results directories. The test runner matters: these switches aren’t interchangeable with the VSTest command-line options.
Container publishing adds reproducible image digests through SOURCE_DATE_EPOCH and avoids redundant layer uploads when the target manifest already exists. NuGet source configuration gains a minimum package publication age setting, which lets teams wait before newly published package versions become eligible for selection. This is an additional policy control, not a replacement for vulnerability checks or reviewing dependencies.
See what’s new in the SDK and tooling for command examples and configuration.
Performance work in .NET 11 reaches both the code you deploy and the tools you use to develop it. Stephen Toub’s Performance Improvements in .NET 11 takes a detailed tour through hundreds of runtime and library optimizations, with benchmarks and code examples.
The just-in-time (JIT) compiler improvements remove more redundant bounds checks and branches, improve devirtualization, and fold more operations into constants. For example, the JIT can optimize additional SequenceEqual calls when it knows the inputs at compile time. These changes improve generated code without requiring you to rewrite the corresponding application logic.
Native AOT interface dispatch uses a shared helper that reduces the code needed at interface call sites and improves throughput for interface-heavy workloads. Hardware support also expands, including FP16 instructions for Half operations on supported x64 and Arm64 hardware and new vector construction and composition APIs.
There’s useful work on diagnostics, too. In-process crash report logging can capture a managed stack trace, module information, and runtime state before a process exits. Previously available on mobile platforms, this reporting path now also supports Linux and macOS.
As always, measure the effect on your own application. Throughput, startup time, memory use, and deployment size depend on the workload and publishing options you choose.
Runtime Async has been a recurring theme throughout the .NET 11 previews. It moves asynchronous suspension and resumption into the runtime instead of relying on compiler-generated state machines.
One especially useful result is a clearer live call stack. Profilers and debuggers can show the asynchronous methods themselves instead of the infrastructure used to
访问原文 返回搜索 https://devblogs.microsoft.com/dotnet/announcing-dotnet-11/
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。