INDUSTRY NEWS

.NET 11 Preview 5: Faster Async, Safer Code, and a Build That Warns You

.NET 11 Preview 5 is a quiet release with a few loud details. There is no single headline feature, but the depth is real: async suspension runs about 14 times faster on one benchmark, C# gains unions and closed hierarchies that let the compiler prove your code handles every case, and your build now warns you when a dependency is vulnerable or heading out of support. Here is what matters for developers, and what we would try first. The complete list is in the official Preview 5 release notes.

.NET SDK 11.0.100-preview.5 download table with installers, runtimes, and C# 14 / F# 10 language support

The short version:

  • Runtime-async suspension is dramatically cheaper when a method is already JIT-optimized.
  • C# unions and closed classes bring compiler-checked exhaustiveness.
  • dotnet build now flags vulnerable and end-of-life dependencies.
  • dotnet new ships an MCP Server template for agent tooling.
  • LINQ gets full outer joins; System.Text.Json gets JSON Lines.
  • Blazor static SSR gains client-side validation; EF Core adds an async-misuse warning.

Faster async: a runtime win you get just by upgrading

The most concrete improvement is in runtime-async, the effort to make async methods suspend and resume without heavy state-machine allocation. Preview 5 targets the case where a method has already been optimized by on-stack replacement.

On-stack replacement (OSR) lets the JIT swap a long-running method from unoptimized to optimized code mid-execution, without waiting for the next call. Previously, when an OSR-optimized async method suspended and resumed, it took a general transition path the release notes measured at 10 to 20 times overhead.

JIT assembly diff showing runtime-async suspension code shrinking from 113 to 79 bytes

Preview 5 resumes those methods straight into optimized code instead. On a suspension-heavy benchmark, that cut runtime from 6,357.1 ms to 457.1 ms, close to fourteen times faster, and the generated suspension code got smaller too. You change nothing to get it. The runtime notes also list JIT tuning, new Arm intrinsics, GC compaction work, and continued WebAssembly CoreCLR progress.

C# unions and closed hierarchies: safer code the compiler checks

The language highlights are closed class hierarchies and union declarations, both in preview. Together they let you model "exactly one of these" and have the compiler enforce it.

A closed class can only be derived from inside its own assembly, so the compiler knows the full set of subtypes. That means it can verify a switch covers every case: miss one and you get a compile error instead of a silent fall-through. A closed class is implicitly abstract.

Union declarations go further. A union is a value type holding one of a fixed set of case types, with a generated constructor per case and pattern matching that unwraps it. If you have ever modeled a result-or-error return or a small state machine as an enum plus a pile of nullable fields, this replaces that pattern with something the type system understands. A third preview strand, unsafe evolution, relaxes where pointer types can appear so interop code reads more cleanly. All of this is preview language surface, so try it on a branch, not in production.

Build-time vulnerability and end-of-life checks

The SDK change with the widest reach hides behind a plain summary: dotnet build now runs vulnerability and end-of-life checks. A dependency with a known CVE, or a target framework losing support, shows up as a build warning rather than a surprise in a quarterly audit.

The timing is pointed. .NET 8 and .NET 9 both reach end of support in November 2026, and now your compiler will remind you on every build, moving migration from a date you might miss into a signal you already watch.

An MCP server in one command, plus SDK quality-of-life

dotnet new now includes an MCP Server template. Scaffolding a Model Context Protocol server, which lets an AI agent call your code as a tool, is a one-command start instead of a research task. Two smaller wins round it out: file-based apps can reference other C# files with a #:ref directive (transitive references included), so scripts grow into structured code without a full project, and console apps now include System.Net.Http.Json by default, trimming the setup for the call-an-API-parse-JSON pattern most tools start with.

LINQ full outer joins and JSON Lines

Two library additions delete code you write by hand today. LINQ gets full outer joins, collapsing the manual left-join, right-join, and union workaround into one operator. And System.Text.Json supports JSON Lines: IAsyncEnumerable serializes as newline-separated values, one item per line, through new SerializeAsyncEnumerable overloads. That format is now the default for log streams, batch jobs, and LLM training and eval datasets, so first-class support matters. Also in the box: generic numeric APIs for Random, X25519 key agreement, and zero-copy chunk transfer from StringBuilder.

Blazor static SSR gets client-side validation

Preview 5 continues making Blazor static server-side rendering a real place to build. The standout is client-side validation for SSR forms: add the DataAnnotationsValidator component and a server-rendered form gives instant in-browser feedback with no round trip, for both enhanced and non-enhanced forms. Your .NET model stays the single source of truth, and the server renders metadata that Blazor's JavaScript enforces, so the rules live in one place. QuickGrid can now render without interactivity, and localized validation messages arrive for Blazor and Minimal APIs.

This is where document and data features fit, static-rendered pages with no circuit and no WebAssembly payload. Whatever your app produces, PDFs, Excel exports, Word files, or OCR on an upload, the Iron Suite covers it with ten .NET libraries that run headless and container-ready, no Office install required. For a concrete starting point on the previews, the Blazor Excel export tutorial generates and downloads an XLSX from Blazor Server, and the read-Excel tutorial loads the data back in.

EF Core catches a common async mistake

Entity Framework Core spends the release surfacing problems sooner. The new EF1004 warning fires when an async EF query silently runs synchronously, one of the most common quiet performance bugs and previously invisible without profiling. Query translation also produces cleaner SQL, SQL Server 2022 compatibility becomes the default, and dotnet ef now works with file-based apps.

How to get .NET 11 Preview 5

The previews are available now on the .NET 11 download page. This drop is SDK 11.0.100-preview.5 with C# 14 and F# 10; Microsoft recommends Visual Studio 2026 Insiders or the C# Dev Kit for VS Code. GA is expected November 2026, alongside the .NET 8 and .NET 9 end-of-support date, so time in the previews now is time saved during the migration later.

A good first afternoon: turn on a build and read the new vulnerability and EOL warnings, rewrite one enum-and-nullable model as a union to watch exhaustiveness checks fire, and scaffold the MCP Server template to see how close your code already is to being agent-callable.

Build document features on .NET 11 today

The runtime and language upgrades are worth exploring on their own, and the document features your app needs are ready to build alongside them right now. The Iron Suite is ten .NET libraries under one license, IronPDF, IronXL, IronWord, IronOCR, and six more, all running the same way across .NET 11 through .NET Framework: headless, container-ready, and free of any Office dependency. One license covers whatever the document layer of your app needs, so you are not picking a product per feature.

Start your free Iron Suite trial