Last week, Microsoft's team released .NET 11 Preview 7, an update that brings changes and improvements to the C# language, ASP.NET Core, .NET MAUI, Entity Framework Core, Windows Forms, and F#.

In the C# area, the break and continue statements can now name an enclosing loop or switch, so code can leave or continue an outer construct directly from an inner one without a flag or a goto.


string? foundValue = null; outer: for (int x = 0; x < xMax; x++) { for (int y = 0; y < yMax; y++) { if (GetValue(x, y) is { } value && value == target) { foundValue = value; break outer; } } }
Also, the Union types, still a preview feature, now use a try-both approach that first tests a pattern against the union itself and then against its contained value.

Correspondingly, switch-expression exhaustiveness also understands generic parameters constrained to a closed type, so the compiler no longer warns when every derived case is handled. Further work refines the Unsafe Evolution rules and adds a null check to inline-array helpers, so forming a reference from a null buffer now throws deterministically.


public closed record class Shape; public record class Circle(double Radius) : Shape; public record class Square(double Side) : Shape; static double Area<T>(T shape) where T : Shape => shape switch { Circle(var r) => Math.PI * r * r, Square(var s) => s * s };
ASP.NET Core receives a wide set of additions, most of them centred on Blazor. Interactive Server circuits can now pause themselves when a browser tab is hidden, releasing server resources until the user returns. A new CacheView component caches the rendered output of a server-side subtree, replaying stored HTML on a cache hit to cut processor and memory use.

Furthermore, five new Blazor analyzers ship on by default to flag common mistakes, and QuickGrid gains programmatic scrolling. Validation message localization is now built in and activates as soon as a string localizer is registered, while the ValidatableType and SkipValidation attributes leave preview.

The SignalR .NET client can refresh authentication after a negotiate redirect, endpoints that return server-sent events are described in OpenAPI 3.2, and applications can read the TLS channel-binding token to defend against relay attacks.

One notable change reverses part of Preview 6: automatic cross-origin protection now validates only endpoints that opt in, matching .NET 10 behaviour so existing apps are not broken.

For .NET MAUI, Preview 7 adds cross-platform passkey authentication, XAML Incremental Hot Reload, and Shell route templates,

Next, Entity Framework Core now translates int.Parse and related methods to a SQL Server CAST, rewrites several GroupBy patterns into single joins for cleaner queries, and also adds support for the 16-bit Half type on SQLite.

As reported, the Azure Cosmos DB provider is modernised to use System.Text.Json, also, the Package Manager Console gains a -NoBuild switch for adding and applying migrations.

Windows Forms introduces an opt-in modern rendering pipeline through VisualStylesMode, along with a way to react to system visual settings, deferred form reveal to avoid, as reported, an unstyled flash at startup, and a SuspendPainting scope that reduces flicker during bulk updates.

The F# programming language receives minor compiler fixes, including support for computation-expression bindings within a plain let and correct attribute resolution in recursive modules.

For interested readers and developers, the full release notes for .NET 11 Preview 7 are available on the dotnet/core repository on GitHub.