News

.NET 11 Preview 5 Focuses on Performance, Productivity and Safer Code

.NET 11 Preview 5 delivers mostly under-the-hood performance gains and practical developer productivity improvements--fewer workarounds, safer code, and smoother builds--rather than big headline features.

The preview release notes are grouped into separate areas for libraries, runtime, SDK, C#, ASP.NET Core, .NET MAUI and EF Core. Individual items range from file-based app improvements to Blazor validation, C# language work and .NET MAUI platform changes.

Preview 5 Downloads
[Click on image for larger view.] Preview 5 Downloads (source: Microsoft).

Different forms of the preview as shown in the image above can be downloaded here.

Library Updates Include JSON Lines and LINQ Changes
The library release notes list new library features and reliability improvements. Items include System.Text.Json support for JSON Lines serialization, LINQ full outer joins, key-selector creation for EqualityComparer<T>, generic numeric APIs for Random, StringBuilder chunk transfer without copying, process line-reading changes, reflection support for nullable underlying types, network API additions, X25519 key agreement in cryptography, syndication support for trimmed and Native AOT feed loading, and options validation using a validator type.

For System.Text.Json, IAsyncEnumerable<T> can now be serialized as JSON Lines by using new JsonSerializer.SerializeAsyncEnumerable overloads with topLevelValues set to true. The same method writes a root-level JSON array by default, matching the existing DeserializeAsyncEnumerable shape. JSON Lines output uses \n between values and ignores WriteIndented so each item stays on one line for log streams, message feeds and batch processing.

Runtime Work Targets Async, JIT, GC and WebAssembly
The runtime release notes list runtime-async suspension, JIT optimizations, Arm intrinsics, garbage collection trimming and compaction, Browser/WebAssembly CoreCLR enablement, diagnostics and loader messages, bug fixes and community contributors. Runtime-async suspension and resumption continue to get faster in Preview 5, with the largest win described for async methods optimized by on-stack replacement.

OSR is the JIT feature that lets a long-running method switch from initial code to optimized code while the method is still executing. In Preview 5, runtime-async resumes those methods directly into optimized code instead of taking the general-purpose OSR transition path. The release notes cite a pull request reporting that transition overhead was around 10 to 20 times, with a suspension-heavy benchmark improving from 6,357.1 milliseconds to 457.1 milliseconds. Other runtime-async changes reduce generated suspension-code cost and size.

SDK Adds File-Based App References and Build Checks
The SDK release notes describe new SDK, CLI and template improvements. The list includes file-based apps referencing other C# files, more consistent CLI handling for file-based apps, SDK vulnerability and end-of-life checks during build, an MCP Server template in dotnet new, System.Net.Http.Json included by default in console apps, bearer-token realm validation for container publishing, ANSI output disabled by dotnet test in LLM environments, and an opt-in NativeAOT CLI fast path.

For file-based apps, Preview 5 adds a #:ref directive for referencing another file-based app as a library, with transitive references supported. The #:include and #:exclude directives no longer require feature flags, directives inside included files are processed transitively without a feature flag, duplicate #:project and #:ref entries are allowed to match MSBuild item behavior, and other duplicate directives across included files now produce a diagnostic instead of being silently accepted.

C# Preview Work Covers Closed Classes and Unions
The C# release notes list three language and compiler areas for .NET 11 Preview 5: closed class hierarchies, union declarations and union patterns, and unsafe-code changes. A closed class can only be directly derived from in the same assembly, and the compiler can use known derived types when checking switch-expression exhaustiveness. A closed class is implicitly abstract, direct subtypes must be declared in the same assembly as the closed base class, and a switch expression over a closed class is exhaustive when it handles all reachable direct subtypes.

Union declarations create a value type whose value can be one of a fixed set of case types. Pattern matching unwraps the union value, and switch expressions are exhaustive when they handle every case type. The preview rules include compiler-generated public constructors for each case type, implicit conversion from a case value to the union type, pattern matching against the contained value and errors for ambiguous union conversions.

The same C# notes describe Unsafe Evolution as preview work for .NET 11. In Preview 5, pointer types and pointer values can appear outside an unsafe context, while the unsafe boundary moves to operations that dereference unmanaged memory or call members marked unsafe. The feature surface and rules can still change before it ships.

ASP.NET Core Focuses on Blazor and Validation
The ASP.NET Core release notes list Blazor SSR client-side validation, async form validation, localized validation errors for Blazor and Minimal APIs, QuickGrid support without interactivity, Blazor WebAssembly culture preservation, SupplyParameterFromSession for Blazor, Blazor WebAssembly Gateway, render-mode boundary support for child content, Kestrel trailer header timeouts and OpenAPI schema changes.

For Blazor SSR forms, forms now get instant in-browser validation feedback without a server round trip. The feature is enabled by default for SSR forms that include the DataAnnotationsValidator component, and both enhanced and non-enhanced forms are supported. The .NET model remains the single source of truth for validation rules, while the server renders metadata that Blazor JavaScript code enforces on the client side.

MAUI Preview Includes Reliability and Platform Fixes
The .NET MAUI release notes describe a reliability wave alongside targeted APIs and Android platform progress. Changes include animations with CancellationToken-aware overloads, BoxView Fill with Brush support, a Windows Maps implementation backed by Azure Maps, public Material 3 handlers and helpers, an accessibility label for toolbar back buttons, Android minimum SDK API 24, .NET for Android API 37 stabilization, Apple workload binding refreshes, improved dev-loop builds and Apple Intelligence APIs in Essentials.AI.

The reliability rollup targets the net11.0 branch and includes fixes across CollectionView, CarouselView, Shell, gestures, layout, RTL and FlowDirection, SearchHandler, TabBar, Label, GraphicsView, SwipeView, HybridWebView, Entry, Editor, Picker, BoxView, ImageButton, RadioButton, AppThemeBinding, navigation lifecycle, Setter.TargetName and ControlTemplate scenarios. The notes cite TapGestureRecognizer reliability on Android among the highlighted fixes.

EF Core Adds File-Based App Support
The EF Core release notes list support for dotnet ef with file-based apps, configuration file support for dotnet ef, EF1004 warnings when async EF queries run synchronously, SQL Server 2022 compatibility as the default, temporal period properties mapping to CLR properties, generated C# with file-scoped namespaces and cleaner SQL from query translation.

The dotnet ef update allows migration and scaffolding commands to work with file-based C# apps. Developers can use --file for the target app and --startup-file when the design-time startup file differs. Existing --project and --startup-project workflows continue to work for SDK-style projects. Preview 5 also improves dotnet ef diagnostics for file-based apps and project metadata failures by surfacing root MSBuild or SDK errors when metadata build output includes them.

Tooling Guidance and Download Status
Developers can install the .NET 11 SDK to get started. The announcement recommends the latest Visual Studio 2026 Insiders for Windows developers using Visual Studio. The C# Dev Kit extension is identified as the Visual Studio Code path for .NET 11 work.

About the Author

David Ramel is an editor and writer at Converge 360.

comments powered by Disqus

Featured

  • .NET 11 Preview 5 Focuses on Performance, Productivity and Safer Code

    .NET 11 Preview 5 focuses on under-the-hood runtime performance gains, streamlined APIs and language features that reduce boilerplate, plus built‑in security checks and incremental ASP.NET Core and EF Core improvements aimed at everyday developer productivity.

  • VS Code 1.124 Focuses on Agent Autonomy and Parallel Sessions

    Microsoft's June 2026 VS Code update turns on Autopilot by default and adds background sending for agent sessions.

  • Developing Agentic Systems in .NET: From Concept to Code

    ZioNet founder Alon Fliess previews his Visual Studio Live! San Diego session on building true agentic systems in .NET -- covering the cognitive loop, MCP tool integration, multi-agent orchestration and enterprise hosting and governance with the Microsoft Agent Framework.

  • Mastering AI Development and Building AI Apps with GitHub Copilot

    Two Microsoft experts explain how GitHub Copilot is evolving from a coding assistant into a broader platform for building, customizing and testing AI-powered developer workflows.

Subscribe on YouTube