What's New in .NET 11?

csharpdotnetlinq
What's New in .NET 11?

.NET 11 shipped on November 10, 2026 with C# 15, a full outer join in LINQ, built-in Zstandard compression, and a test runner that can put a time limit on an entire test session. The .NET runtime libraries now use Runtime Async. Your application can try the same compilation model, but it still requires a preview switch.

What Changes When You Install the SDK?

Install the .NET 11 SDK on a build agent and it can use the new CLI host and reuse a warm MSBuild server across builds. If a service still targets net10.0, try adding a call to Enumerable.FullJoin. The compiler can't find it because the project still builds against the .NET 10 reference assemblies.

Where the change livesWhat you can useWhat to change
SDKxUnit v3 templates and run-wide timeouts on Microsoft.Testing.PlatformSelect the 11 SDK. Check dotnet --version in the repository.
Language and librariesC# 15 collection expression arguments, LINQ FullJoin, ZstandardStreamTarget net11.0 in a project built with the 11 SDK.
RuntimeJIT improvements and framework libraries built with Runtime AsyncRun the published application on the .NET 11 runtime.
Application compiler optionRuntime Async for eligible methods in your codeOpt in when building the project and compare the two builds.

You can create an xUnit v3 project and set a timeout for the test run on the build agent. If you publish a framework-dependent web service for net11.0, its production image also needs the ASP.NET Core 11 runtime.

Using C# 15 in a Two-File Script

File-based apps let you run a C# file without creating a project. Use #:include to share a helper between scripts. That directive also works on SDK 10.0.403. The part of this example that needs C# 15 is the with(...) argument below.

Take an export job that treats eu and EU as the same region. In Regions.cs, use a C# 15 collection expression to pass a case-insensitive comparer to the set's constructor.

static class Regions
{
    public static HashSet<string> Unique(string[] codes) =>
        [with(StringComparer.OrdinalIgnoreCase), .. codes];
}

Put the entry point, Export.cs, beside Regions.cs.

#!/usr/bin/env dotnet
#:include Regions.cs

var regions = Regions.Unique(args);
Console.WriteLine($"Exporting {regions.Count} regions");

Run dotnet run --file Export.cs -- eu EU us with the 11 SDK. It prints Exporting 2 regions. Remove the comparer and you get three.

Finding Unmatched Stock and Winning Bids

When you reconcile a warehouse count against a storefront catalog, a missing SKU is often the row you most need to see. An inner join drops it. LINQ's new FullJoin keeps it whether it's missing from the warehouse or the storefront.

In EF Core 11, MaxByAsync can return the bid with the highest amount, including the bidder's ID. Two bidders can offer the same amount, though. If the lower bid ID should win a tie, sort by amount descending, then by ID ascending before taking the first row.

Streaming and Compressing an Export

If the importer reads JSON one line at a time, pass topLevelValues: true to JsonSerializer.SerializeAsyncEnumerable. It writes each item from an IAsyncEnumerable<T> as one JSON value followed by a line feed. Without that argument, it writes a single JSON array.

For a partner that accepts .zst files, you can write the export through a ZstandardStream as the records arrive. Dispose the encoder before handing the file to the importer so the last block gets written.

If the import runs as a command-line tool, Process.RunAndCaptureTextAsync gives you its standard output, standard error, and exit status in one call. A successful import can still write warnings to standard error, so check the exit code before marking the job as failed.

What Does Runtime Async Change?

The .NET 11 JIT can remove more redundant bounds checks and turn more virtual calls into direct calls. Existing code can benefit when you run it on the new runtime.

With Runtime Async, the runtime can also suspend and resume an eligible method at an await. By default, the C# compiler still generates a state machine for your application's async methods. One way to see what the Runtime Async switch changes is to inspect the same method's metadata before and after recompiling it.

Caching Blazor HTML and Compressing HTTP Responses

A server-rendered catalog page can show the same category list to every shopper while each shopper sees a different cart. Wrap just the list in Blazor's new CacheView component. On a cache hit during static server-side rendering, Blazor reuses the list's HTML without even constructing its child components.

If the list depends on the category or language, include that value in the cache key. Otherwise a shopper who asks for tools can get the cached list of books.

ASP.NET Core 11 also supports Zstandard for HTTP requests and responses. A partner can request a compressed download with Accept-Encoding: zstd, then send those same bytes to an import endpoint with Content-Encoding: zstd.

What Should You Check Before Deploying?

Fail a worker in staging and check what the scheduler records. With the default host settings, RunAsync on .NET 11 rethrows the worker's exception after shutdown. The same call could complete successfully on .NET 10, so a scheduler may now retry a job it used to mark as finished. You can reproduce the worker failure by throwing from BackgroundService.ExecuteAsync.

If CI builds the staging and production images separately, compare their manifest digests. The .NET 11 SDK supports reproducible container builds when both jobs use the same inputs and the same SOURCE_DATE_EPOCH.

Summary

If you're running .NET 10 LTS, both releases receive patches through November 14, 2028 under Microsoft's support policy. You can try the new build tools while your service stays on .NET 10. When you need a library feature such as FullJoin, upgrade the service and its deployment image together.

Frequently Asked Questions

When was .NET 11 released, and is it LTS?

.NET 11 shipped on November 10, 2026 as a Standard Term Support release. Microsoft lists November 14, 2028 as the end of support for both .NET 11 STS and .NET 10 LTS.

Which version of C# comes with .NET 11?

C# 15 is the default language version when you target net11.0 with the .NET 11 SDK. Collection expression arguments, extension indexers, and labeled break and continue are available without enabling preview language features.

What do I get if I install the .NET 11 SDK but keep targeting .NET 10?

You can use the new CLI tooling when your repository selects the 11 SDK. A project that still targets net10.0 compiles against the .NET 10 reference assemblies. Retarget it to use built-in .NET 11 library APIs such as Enumerable.FullJoin.

Does Runtime Async turn on automatically in .NET 11?

The .NET runtime libraries ship with Runtime Async. Compiling your own eligible async methods with it is a separate, preview opt-in for projects that target net11.0.

Browse all .NET guides →
Loading comments...

Whenever you're ready, there are 5 ways I can help you:

  1. Pragmatic Self-Hosting: Learn to deploy and run your apps on a VPS with Dokploy and Tailscale. Keep administration private, automate releases, and practice restoring backups, with source code and a runbook you can reuse.
  2. Pragmatic Clean Architecture: Join 5,000+ students in this comprehensive course that will teach you the system I use to ship production-ready applications using Clean Architecture. Learn how to apply the best practices of modern software architecture.
  3. Modular Monolith Architecture: Join 2,800+ engineers in this in-depth course that will transform the way you build modern systems. You will learn the best practices for applying the Modular Monolith architecture in a real-world scenario.
  4. Pragmatic REST APIs: Join 1,900+ students in this course that will teach you how to build production-ready REST APIs using the latest ASP.NET Core features and best practices. It includes a fully functional UI application that we'll integrate with the REST API.
  5. Patreon Community: Join a community of 5,000+ engineers and software architects. You will also unlock access to the source code I use in my YouTube videos, early access to future videos, and exclusive discounts for my courses.

The .NET Weekly

One practical .NET tip, every Saturday.

Join 66,000+ engineers who read it. Free, and you can unsubscribe any time.