Sr. Content Developer at Microsoft, working remotely in PA, TechBash conference organizer, former Microsoft MVP, Husband, Dad and Geek.
164836 stories
·
33 followers

Microsoft Releases .NET 11 and C♯ 15 - Union Types, Runtime Async and Native AOT CLI

1 Share

For more than a decade, C# architects have begged Microsoft for native discriminated unions and an end to the hidden memory allocations caused by compiler-generated async/await state machines. At .NET Conf 2026, Microsoft delivered both in a single release by shipping .NET 11 and C# 15 into general availability.

 

Backed by 24 months of Standard Term Support (STS) through November 2028 and shaped by over 7,000 community contributors, this release replaces async state-machine boilerplate with 0-byte Runtime Async execution, turns on a Native AOT CLI host by default, and moves .NET MAUI onto CoreCLR. At the same time, November 10, 2026 marks the official End of Support for both .NET 8 and .NET 9—making your upgrade roadmap an immediate priority.

 

Microsoft Announces .NET 11 and C# 15 Release with Union Types Runtime Async and CoreCLR for MAUI
Inside Microsoft's .NET 11 and C# 15 general availability release: Native union types, Runtime Async execution, CoreCLR for .NET MAUI, and built-in MCP agent tooling.

 

Table of Contents

 

  • C# 15 Union Types & Closed Hierarchies: Declare concise public union return types and assembly-sealed closed class hierarchies with full compiler exhaustiveness checking in switch expressions.
  • Runtime Async Hits CoreCLR: All .NET 11 base libraries ship compiled with runtime-async=on, slashing synchronous async completion from 21.2 ns (144 B) down to 6.2 ns (0 B allocated) and cleaning up live debugger call stacks.
  • Native AOT CLI & Warm MSBuild Server: The SDK runs a Native AOT CLI host by default, includes a built-in dotnet new mcpserver template, and introduces the preview dotnetup toolchain manager.
  • CoreCLR Default for .NET MAUI 11: Unifies mobile and desktop workloads on CoreCLR alongside XAML Incremental Hot Reload, while ASP.NET Core 11 defaults to OpenAPI 3.2 and async validation.
  • .NET 8 & .NET 9 End of Support Alert: Both .NET 8 and .NET 9 reached End of Support on November 10, 2026—teams must move to .NET 11 (2-year STS) or .NET 10 (3-year LTS) to keep receiving security updates.

 

🚀 Download Visual Studio 2026

Looking to get started with the latest C# 15 features, .NET 11 Runtime Async support, and modern AI development tooling? Grab the official Community, Professional, or Enterprise installer directly from our dedicated hub.

 

C# 15 Finally Ships Native Union Types and Closed Hierarchies

As confirmed in Microsoft's official Announcing .NET 11 blog post, C# 15 is the default language version for all net11.0 projects. Its headline addition is native union types—letting a method return any of a declared set of case types without boxing into object or inventing artificial base classes:

 

public sealed record Product(int Id, string Name);
public sealed record ProductNotFound(int Id);
public union ProductLookup(Product, ProductNotFound);

ProductLookup result = new Product(42, "Mechanical keyboard");
string message = result switch {
  Product p => $"Found {p.Name}",
  ProductNotFound m => $"No product with ID {m.Id}"
};

 

When you own the class hierarchy yourself, C# 15 also introduces closed hierarchies (closed class), which prevent external assemblies from subclassing your type so the compiler can guarantee exhaustive pattern matching. In addition, C# 15 adds collection expression arguments—such as HashSet<string> names = [with(StringComparer.OrdinalIgnoreCase), "Alice", "ALICE", "Bob"];—alongside extension indexers and labeled break and continue statements.

 

 

How Runtime Async Eliminates Compiler State Machines and Cuts Latency

Ever since C# 5 introduced async and await, the Roslyn compiler has rewritten every async method into a complex state-machine struct that clutters live profiler call stacks and allocates extra heap memory on awaits. In .NET 11, Runtime Async moves suspension and resumption directly into the CoreCLR virtual machine—and Microsoft has already compiled the entire .NET 11 Base Class Library (BCL) with runtime-async=on.

 

You can opt your own net11.0 application code into Runtime Async inside Visual Studio 2026 v18.11 simply by adding <Features>runtime-async=on</Features> to your project file (no preview flag required). The speed and memory gains across Microsoft Learn's .NET 11 runtime benchmarks are dramatic:

  • Synchronous Async Completion: A 2-level async chain completing synchronously drops from 21.2 ns and 144 B allocated down to 6.2 ns and 0 B allocated.
  • Real Await Suspension & Code Size: Await suspension latency drops by 54% (from 254 ns down to 117 ns), while a 10-layer async call chain shrinks from 10,752 bytes to 5,632 bytes of generated native code.
  • Async Exception Unwinding & Clean Debugging: Throwing an exception across 30 async layers plunges from 51.3 microseconds (84.2 KB allocated) to 10.7 microseconds (5.7 KB allocated), while breakpoints and live stack traces finally show your actual methods without compiler noise.

 

 

Faster Native AOT CLI Tooling, Dotnetup and Built-In MCP Server Templates

Daily terminal workflows on a modern Windows 11 developer workstation get an immediate responsiveness boost because the .NET 11 SDK enables a Native AOT CLI host by default and keeps the background MSBuild server warm between invocations. Version queries, help commands, and local tool launches execute instantaneously without spinning up the managed CLR, while the new preview dotnetup toolchain manager simplifies user-level SDK installations.

 

For AI engineers building agentic systems, .NET 11 bakes Model Context Protocol (MCP) server architecture right into the SDK. Running dotnet new mcpserver -o MyMcpServer scaffolds a production-ready C# MCP tool server in seconds, which pairs cleanly with Microsoft.Extensions.AI (MEAI), the Microsoft Agent Framework (MAF), Microsoft Foundry IQ deployments, and the new .NET Upgrade Canvas inside GitHub Copilot.

 

 

What Is New in ASP.NET Core 11, Blazor AG-UI and Entity Framework Core 11

Web, cloud, and data-access workloads receive deep stack-wide integration for C# 15 and high-density server hosting. Here is how the major workload upgrades break down across the .NET 11 stack:

 

🌐 ASP.NET Core 11 & Blazor Agentic UI

Union JSON & OpenAPI 3.2 Default: Minimal APIs and MVC serialize C# 15 unions natively via System.Text.Json and emit anyOf schemas in OpenAPI 3.2 (including server-sent event payloads).

Async Validation & Circuit Pause: New asynchronous DataAnnotations APIs allow non-blocking database checks during validation, while Blazor adds static CacheView subtree caching, inactive-tab circuit pausing to free SignalR memory, and experimental AG-UI Blazor AI components.

🗄️ Entity Framework Core 11 & Base Class Libraries

LINQ FullJoin & SQL Server Vectors: Both LINQ and EF Core 11 support the new FullJoin operator, complex types and JSON columns on TPT/TPC inheritance tables, and experimental SQL Server vector index search.

Zstandard & 0-Copy Streams: System.IO.Compression adds native Zstandard (Zstd) support alongside 4 in-memory 0-copy stream adapters (ReadOnlyMemoryStream, WritableMemoryStream, ReadOnlySequenceStream, and StringStream) and single-call Process execution APIs.

 

 

Why .NET MAUI Switching to CoreCLR Changes Cross-Platform Mobile Development

On the client side, .NET MAUI 11 completes a foundational architectural shift by replacing the legacy Mono runtime with CoreCLR as its default runtime across mobile and desktop platforms (using precompiled code and the interpreter on Apple iOS/iPadOS where JIT is restricted). That unification means your mobile apps now share the exact same runtime semantics and base library optimizations as your cloud services.

 

Developer iteration in MAUI and Windows desktop frameworks is also much smoother. .NET MAUI 11 enables XAML Incremental Hot Reload by default in Debug builds, supports implicit XAML namespace declarations, switches Windows to the faster CollectionView2 handler, and pairs with the experimental .NET MAUI DevFlow agentic UI inspector—while Windows Forms gains an opt-in modern visual styles mode and suspended bulk painting.

 

 

Urgent Upgrade Guide as .NET 8 and .NET 9 Reach End of Support

There is a critical security deadline buried inside the .NET 11 launch announcement: both .NET 8 (LTS) and .NET 9 (STS) reached End of Support on November 10, 2026. As we saw during last month's emergency out-of-band .NET security update for CVE-2026-70197, running unpatched runtimes in production exposes web APIs and Kestrel servers to severe risk.

 

If your enterprise policy mandates a Long-Term Support track, migrate your remaining .NET 8 and .NET 9 services to .NET 10 (LTS) immediately. If you want C# 15 union types, 0-byte Runtime Async, and the 24-month STS support window through November 2028, update your global.json and target frameworks to net11.0, verify your container base images against .NET 11's updated minimum x64/Arm64 CPU instruction baselines, and test your deployment pipeline today.

 

 

Frequently Asked Questions (FAQ)

  1. Is .NET 11 a Long-Term Support (LTS) or Standard Term Support (STS) release?
    .NET 11 is a Standard Term Support (STS) release launched on November 10, 2026 during .NET Conf 2026. Under Microsoft's servicing policy, it receives 24 months (2 years) of official security and reliability updates through November 2028, while .NET 10 remains the active 3-year LTS release.
  2.  

  3. Did .NET 8 and .NET 9 reach End of Support alongside the .NET 11 launch?
    Yes. Both .NET 8 (LTS) and .NET 9 (STS) officially reached End of Support on November 10, 2026. Production workloads still running on .NET 8 or .NET 9 no longer receive monthly security patches and should migrate to either .NET 11 (STS) or .NET 10 (LTS).
  4.  

  5. How do Union Types and Closed Hierarchies work in C# 15?
    C# 15 introduces the 'public union' declaration (such as 'public union ProductLookup(Product, ProductNotFound);'), allowing a return value to hold any of a fixed set of case types with automatic conversions and compiler-enforced exhaustiveness checking in switch expressions. Closed hierarchies ('closed class') restrict direct inheritance to the declaring assembly for exhaustive pattern matching.
  6.  

  7. What is Runtime Async in .NET 11 and how do I enable it?
    Runtime Async moves async/await suspension and resumption directly into the CoreCLR runtime instead of generating compiler state-machine structs. While .NET 11's base class libraries are already compiled with Runtime Async enabled, you can opt your project in by adding '<Features>runtime-async=on</Features>' inside your .csproj file without needing '<EnablePreviewFeatures>true</EnablePreviewFeatures>'.
  8.  

  9. How much faster is Runtime Async compared to traditional C# async state machines?
    In Microsoft's .NET 11 benchmarks, a 2-level async chain completing synchronously drops from 21.2 ns (144 B allocated) down to 6.2 ns with 0 B allocated. Real await suspension drops from 254 ns to 117 ns, and throwing an exception through 30 async frames drops from 51.3 microseconds (84.2 KB) to 10.7 microseconds (5.7 KB).
  10.  

  11. Why do 'dotnet' CLI commands feel noticeably faster in the .NET 11 SDK?
    The .NET 11 SDK enables a Native AOT CLI host by default and keeps the background MSBuild server warm across CLI runs. Commands like version checks, help queries, and tool invocations execute natively without spinning up the managed runtime.
  12.  

  13. What changed in .NET MAUI 11 with CoreCLR?
    .NET MAUI 11 switches its default runtime from Mono to CoreCLR across mobile and desktop platforms, unifying mobile apps with server and desktop .NET workloads. It also adds XAML Incremental Hot Reload in Debug builds, implicit XAML namespaces, and CollectionView2 by default on Windows.
  14.  

  15. How does .NET 11 support Model Context Protocol (MCP) and AI agents out of the box?
    The .NET 11 SDK includes a built-in MCP server template ('dotnet new mcpserver -o MyMcpServer'), paired with Microsoft.Extensions.AI (IChatClient and IEmbeddingGenerator), the Microsoft Agent Framework (MAF), and experimental Blazor AI components supporting the Agent User Interaction Protocol (AG-UI).
  16.  

  17. What are the biggest upgrades in ASP.NET Core 11 and Blazor?
    ASP.NET Core 11 adds native System.Text.Json serialization and OpenAPI 3.2 'anyOf' schema generation for C# 15 union types, asynchronous DataAnnotations validation, SignalR authentication refresh without reconnecting, Blazor CacheView static subtree caching, and automatic circuit pause for inactive browser tabs.
  18.  

  19. What is new in Entity Framework Core 11 and the .NET 11 Base Class Libraries?
    EF Core 11 translates the new LINQ FullJoin operator into SQL, eliminates redundant joins in split queries, supports complex types and JSON columns on TPT/TPC inheritance models, and adds experimental SQL Server vector search. The BCL adds native Zstandard (Zstd) compression, 4 in-memory 0-copy stream adapters, and simplified single-call Process APIs.

 

 

End Note

Between C# 15 union types, Runtime Async cutting synchronous await overhead to 0 bytes, a snappy Native AOT CLI host, and CoreCLR becoming the default runtime for .NET MAUI, Microsoft's .NET 11 release ranks among the most impactful upgrades in the platform's history. Are you migrating your production workloads straight to net11.0 for C# 15 unions, or holding steady on .NET 10 LTS? Let me know in the comments below!

 

.NET 11 Runtime Async Benchmark Gains C# 15 Union Types and .NET 8/9 End of Support Migration Checklist
Upgrading to .NET 11 in November 2026: Combining C# 15 union types, 0-byte Runtime Async execution, and Native AOT CLI tooling as .NET 8 and .NET 9 reach End of Support.

 

Read the whole story
alvinashcraft
just a second ago
reply
Pennsylvania, USA
Share this story
Delete

Build and Secure a C# MCP Server with .NET 11 and Duende IdentityServer

1 Share
For me, the Model Context Protocol (MCP) is a must-have for anyone building applications. MCP lets users access any feature you painstakingly built, whether explicitly or implicitly. Once my imagination comes back to earth, I ask the obvious question: who, exactly, is allowed to call this thing? On my laptop, where the AI harness launches the MCP server as a local subprocess, the answer is the machine boundary. The moment I host the same server over HTTP so that others can reach it, that answer becomes more complicated, and anyone can call my tools, ANYONE (yikes).
Read the whole story
alvinashcraft
23 seconds ago
reply
Pennsylvania, USA
Share this story
Delete

WPF Window.Closing: Why e.Cancel Has No Effect After await, and How to Close Again Safely

1 Share
e.Cancel set after an await in Window.Closing has no effect: WPF reads it as soon as the handler returns. Measures a cancel-first fix and its pitfalls.
Read the whole story
alvinashcraft
28 seconds ago
reply
Pennsylvania, USA
Share this story
Delete

Let your agents cleanup after they leave your desk

1 Share

If you are let multiple agents work in parallel on your code base, you need a way to start an agent session with code isolation. The typical way to do this is by creating separate Git worktrees for each agent. avoids that parallel agents overwrite each other’s files. But the sessions pile up, and so do the worktrees. Each one is a full checkout on your disk.

Until recently I did the cleanup work myself, but now VSCode has a worktree cleanup feature to deal with this.

Why do we need this?

Before this feature, you had two options: do it by hand or ignore it.

By hand meant something like this:

git worktree list
git worktree remove <path>
git worktree prune

That works. But it doesn’t tell you which worktree belongs to which agent session, whether the session is still relevant, or how much space you’ll get back.

Archive, done or delete?

Cleanup builds on how VS Code already finishes sessions. There are three actions:

  • Close a chat tab: hides the conversation, nothing is deleted.
  • Archive (Chat view) or Mark as Done (Agents window): removes the session from the active list but keeps the conversation.
  • Delete: removes the conversation permanently.

When you archive a worktree session, VS Code commits uncommitted changes to the session branch and then removes the worktree folder. The branch and commits stay, so restoring the session re-creates the worktree.

That’s fine for one session. It doesn’t scale to thirty.

Using the worktree cleanup editor

Open the command palette in the VSCode Agents Window and run Chat: Open Worktree Cleanup.

 


Then:

  1. Choose an inactivity filter and, if needed, a workspace.
  2. Review the selected worktrees. You see the branch, the path and an estimated size for each. Select the ones you want to delete.
  3. Click on Clean Up Worktree.

So, what happens when you confirm? Normal cleanup does the following:

  • marks the listed sessions as done
  • commits non-ignored uncommitted changes to their branches
  • schedules the worktree folders for removal

Branches and session history are kept. If you need a session later, restore it and the worktree is re-created.

Remark: Ignored files are not committed. Anything in .gitignore (build output, node_modules, local config) is deleted together with the worktree. Normal cleanup also protects worktrees that are used by other sessions or chats.

The cleanup editor also finds worktrees you’d never find through the sessions list:

  • Leftover worktrees from done or archived sessions. Marking a session as done doesn’t guarantee its worktree was removed.
  • Managed worktrees without a listed session. These are Git-registered worktrees under the <repository>.worktrees directory. Worktrees you created yourself elsewhere are excluded.

Remark: The sizes are estimates. An unknown size doesn’t mean zero storage, and a failed cleanup doesn’t confirm the worktree is gone. If something fails, use Retry Failed Worktrees.

Automatic cleanup of merged sessions

It even gets better and you have the option to configure automatic cleanup. 


The first checkbox marks a session as done after the given number of days of inactivity. The second checkbox permanently deletes it after a grace period. 

A session is only eligible when it has a merged pull request and no related open pull requests. Automatic cleanup is also more careful than manual archiving. It only removes a worktree if the branch tracks an upstream and has no outgoing commits or uncommitted changes. It never force-removes.

That’s it! Run it once, look at the size of what you get back, and decide if you want it automated.

More information

Read the whole story
alvinashcraft
1 minute ago
reply
Pennsylvania, USA
Share this story
Delete

.NET 11: Controllers finally get new features

1 Share

New features in .NET 11, including ShortCircuit in Controllers, union types and async validation, plus how to update your application.

Read the whole story
alvinashcraft
1 minute ago
reply
Pennsylvania, USA
Share this story
Delete

An unexpected, but yet expected, Winget challenge

1 Share
You may or may not have seen a blog post from Thomas Mahony talking about how Winget is drowning and one person is keeping it afloat: It occurred to me at the time that would mean a backlog of new apps being added. What didn’t occur to me: the backlog would also include app version […]







Read the whole story
alvinashcraft
1 minute ago
reply
Pennsylvania, USA
Share this story
Delete
Next Page of Stories