cd /news/developer-tools/net-11-preview-5-brings-file-based-a… · home topics developer-tools article
[ARTICLE · art-33704] src=infoq.com ↗ pub= topic=developer-tools verified=true sentiment=↑ positive

.NET 11 Preview 5: Brings File-Based App Improvements, New C# Features, and a Blazor Validation Wave

Microsoft released .NET 11 Preview 5, introducing file-based app improvements, new C# features like closed classes and union declarations, and Blazor client-side validation. The update also includes SDK enhancements, ASP.NET Core Blazor updates, and .NET MAUI reliability fixes.

read3 min views1 publishedJun 19, 2026

Last week, Microsoft has released the fifth preview of .NET 11, delivering updates across the runtime, SDK, libraries, ASP.NET Core, .NET MAUI, C#, and Entity Framework Core.

The .NET SDK gains several improvements for file-based apps. According to the release notes, developers can now split code across files using the new #:ref directive, which references another file-based app as a library, without first creating a project. More command-line tools, including package and NuGet commands, now understand file-based app paths.

The SDK also bundles the Model Context Protocol server template, so* dotnet new mcpserver* works without a separate package. Also, projects can opt in to checks that warn when the installed SDK has known vulnerabilities or has reached end of life.

Console and worker appsthat target

net11.0now include

System.Net.Http.Jsonautomatically when implicit usings are enabled.

The C# language receives three notable additions, all still in preview. A closed class can only be derived from within the same assembly, which, as stated in the documentation, lets the compiler verify that switch expressions handle every case.

public closed record class GateState;
public record class Closed : GateState;
public record class Open(float Percent) : GateState;

static string Describe(GateState state) => state switch
{
    Closed => "closed",
    Open(var percent) => $"{percent}% open"
};

A new union declaration creates a value type that holds one of a fixed set of case types, with pattern matching support. Work also continues on Unsafe Evolution, which allows pointer types to appear outside an unsafe context while keeping the unsafe boundary on operations that read unmanaged memory.

int value = 42;
int* pointer = &value;

unsafe
{
    System.Console.WriteLine(*pointer);
}

Next, ASP.NET Core focuses heavily on Blazor. Server-side rendered forms now support instant client-side validation without a server round-trip, and forms gain support for async validation rules such as database lookups.

Validation messages and property names can be localized. QuickGrid sorting and pagination now work on statically rendered pages, and also the standalone Blazor WebAssembly apps get a new development server called the Gateway, which adds built-in SPA fallback routing.

Futhermore, .NET MAUI receives a large reliability rollup that, according to the source, fixes dozens of reported issues across controls such as CollectionView, Shell, and Label.

Animation methods gain CancellationToken-aware overloads. Regarding the controls, sveral of them recieves updates, BoxView adds a *Fill *property that accepts brushes, and the Windows Map control now has a real implementation backed by Azure Maps. The minimum Android version rises to API 24, and Apple Intelligence APIs ship in Essentials.AI.

Entity Framework Core adds support for file-based apps in the dotnet ef tool and a configuration file for storing default options. A new analyzer warning, EF1004, flags async queries that would run synchronously. The SQL Server 2022 compatibility is now the default, and generated C# uses file-scoped namespaces.

Other changes in this release are stricter container registry authentication validation, an opt-in Native AOT mode for the CLI, cleaner SQL query translation in EF Core, and the disabling of ANSI output during dotnet test in LLM environments.

For interested readers, the full release notes are available on the dotnet/core repository on GitHub.

── more in #developer-tools 4 stories · sorted by recency
── more on @microsoft 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/net-11-preview-5-bri…] indexed:0 read:3min 2026-06-19 ·