{"id":507643,"date":"2026-06-19T08:52:09","date_gmt":"2026-06-19T08:52:09","guid":{"rendered":"https:\/\/www.newsbeep.com\/ie\/507643\/"},"modified":"2026-06-19T08:52:09","modified_gmt":"2026-06-19T08:52:09","slug":"net-11-preview-5-brings-file-based-app-improvements-new-c-features-and-a-blazor-validation-wave","status":"publish","type":"post","link":"https:\/\/www.newsbeep.com\/ie\/507643\/","title":{"rendered":".NET 11 Preview 5: Brings File-Based App Improvements, New C# Features, and a Blazor Validation Wave"},"content":{"rendered":"<p>Last week, Microsoft has released the <a href=\"https:\/\/github.com\/dotnet\/core\/blob\/main\/release-notes\/11.0\/preview\/preview5\/README.md\" rel=\"nofollow noopener\" target=\"_blank\">fifth preview of .NET 11<\/a>, delivering updates across the runtime, SDK, libraries, ASP.NET Core, .NET MAUI, C#, and Entity Framework Core.<\/p>\n<p>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 <a href=\"https:\/\/github.com\/dotnet\/core\/blob\/main\/release-notes\/11.0\/preview\/preview5\/sdk.md#file-based-apps-can-reference-other-c-files\" rel=\"nofollow noopener\" target=\"_blank\">#:ref directive<\/a>, 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.<\/p>\n<p>The SDK also bundles the <a href=\"https:\/\/github.com\/dotnet\/core\/blob\/main\/release-notes\/11.0\/preview\/preview5\/sdk.md#dotnet-new-includes-the-mcp-server-template\" rel=\"nofollow noopener\" target=\"_blank\">Model Context Protocol<\/a> 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. <a href=\"https:\/\/github.com\/dotnet\/core\/blob\/main\/release-notes\/11.0\/preview\/preview5\/sdk.md#console-apps-include-systemnethttpjson-by-default\" rel=\"nofollow noopener\" target=\"_blank\">Console and worker apps<\/a> that target net11.0 now include System.Net.Http.Json automatically when implicit usings are enabled.<\/p>\n<p>The <a href=\"https:\/\/github.com\/dotnet\/core\/blob\/main\/release-notes\/11.0\/preview\/preview5\/csharp.md#c-in-net-11-preview-5---release-notes\" rel=\"nofollow noopener\" target=\"_blank\">C# language<\/a> 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.<\/p>\n<p>&#13;<br \/>\npublic closed record class GateState;&#13;<br \/>\npublic record class Closed : GateState;&#13;<br \/>\npublic record class Open(float Percent) : GateState;&#13;<br \/>\n&#13;<br \/>\nstatic string Describe(GateState state) =&gt; state switch&#13;<br \/>\n{&#13;<br \/>\n    Closed =&gt; &#8220;closed&#8221;,&#13;<br \/>\n    Open(var percent) =&gt; $&#8221;{percent}% open&#8221;&#13;<br \/>\n};<\/p>\n<p>A new <a href=\"https:\/\/github.com\/dotnet\/core\/blob\/main\/release-notes\/11.0\/preview\/preview5\/csharp.md#union-declarations-and-union-patterns\" rel=\"nofollow noopener\" target=\"_blank\">union declaration<\/a> creates a value type that holds one of a fixed set of case types, with pattern matching support. Work also continues on <a href=\"https:\/\/github.com\/dotnet\/core\/blob\/main\/release-notes\/11.0\/preview\/preview5\/csharp.md#unsafe-evolution\" rel=\"nofollow noopener\" target=\"_blank\">Unsafe Evolution<\/a>, which allows pointer types to appear outside an unsafe context while keeping the unsafe boundary on operations that read unmanaged memory.<\/p>\n<p>&#13;<br \/>\nint value = 42;&#13;<br \/>\nint* pointer = &amp;value;&#13;<br \/>\n&#13;<br \/>\nunsafe&#13;<br \/>\n{&#13;<br \/>\n    System.Console.WriteLine(*pointer);&#13;<br \/>\n}<\/p>\n<p>Next, <a href=\"https:\/\/github.com\/dotnet\/core\/blob\/main\/release-notes\/11.0\/preview\/preview5\/aspnetcore.md\" rel=\"nofollow noopener\" target=\"_blank\">ASP.NET Core<\/a> focuses heavily on Blazor. Server-side rendered forms now support instant <a href=\"https:\/\/github.com\/dotnet\/core\/blob\/main\/release-notes\/11.0\/preview\/preview5\/aspnetcore.md#blazor-ssr-supports-client-side-validation\" rel=\"nofollow noopener\" target=\"_blank\">client-side validation<\/a> without a server round-trip, and forms gain support for async validation rules such as database lookups.<\/p>\n<p>Validation messages and property names can be localized. <a href=\"https:\/\/github.com\/dotnet\/core\/blob\/main\/release-notes\/11.0\/preview\/preview5\/aspnetcore.md#quickgrid-works-without-interactivity\" rel=\"nofollow noopener\" target=\"_blank\">QuickGrid<\/a> sorting and pagination now work on statically rendered pages, and also the\u00a0standalone Blazor WebAssembly apps get a new development server called the <a href=\"https:\/\/github.com\/dotnet\/core\/blob\/main\/release-notes\/11.0\/preview\/preview5\/aspnetcore.md#blazor-webassembly-gateway\" rel=\"nofollow noopener\" target=\"_blank\">Gateway<\/a>, which adds built-in SPA fallback routing.<\/p>\n<p>Futhermore, <a href=\"https:\/\/github.com\/dotnet\/core\/blob\/main\/release-notes\/11.0\/preview\/preview5\/dotnetmaui.md\" rel=\"nofollow noopener\" target=\"_blank\">.NET MAUI<\/a> receives a large reliability rollup that, according to the source, fixes dozens of reported issues across controls such as CollectionView, Shell, and Label.<\/p>\n<p><a href=\"https:\/\/github.com\/dotnet\/core\/blob\/main\/release-notes\/11.0\/preview\/preview5\/dotnetmaui.md#animations-get-cancellationtoken-aware-overloads\" rel=\"nofollow noopener\" target=\"_blank\">Animation methods<\/a> gain CancellationToken-aware overloads. Regarding the controls, sveral of them recieves updates,\u00a0BoxView 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.<\/p>\n<p><a href=\"https:\/\/github.com\/dotnet\/core\/blob\/main\/release-notes\/11.0\/preview\/preview5\/efcore.md\" rel=\"nofollow noopener\" target=\"_blank\">Entity Framework Core<\/a> adds support for file-based apps in the <a href=\"https:\/\/github.com\/dotnet\/core\/blob\/main\/release-notes\/11.0\/preview\/preview5\/efcore.md#dotnet-ef-supports-file-based-apps\" rel=\"nofollow noopener\" target=\"_blank\">dotnet ef tool<\/a> 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.<\/p>\n<p>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.<\/p>\n<p>For interested readers, the <a href=\"https:\/\/github.com\/dotnet\/core\/blob\/main\/release-notes\/11.0\/preview\/preview5\/README.md\" rel=\"nofollow noopener\" target=\"_blank\">full release notes<\/a>\u00a0are available on the\u00a0<a href=\"https:\/\/github.com\/dotnet\/core\" rel=\"nofollow noopener\" target=\"_blank\">dotnet\/core repository<\/a>\u00a0on GitHub.<\/p>\n","protected":false},"excerpt":{"rendered":"Last week, Microsoft has released the fifth preview of .NET 11, delivering updates across the runtime, SDK, libraries,&hellip;\n","protected":false},"author":2,"featured_media":507644,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[80235,164270,80233,80234,216891,8853,216890,61,60,32000,80],"class_list":["post-507643","post","type-post","status-publish","format-standard","has-post-thumbnail","category-technology","tag-net-10","tag-net-11","tag-net-9","tag-net-core","tag-asp-net-core","tag-development","tag-dotnet-11-preview-5","tag-ie","tag-ireland","tag-net","tag-technology"],"_links":{"self":[{"href":"https:\/\/www.newsbeep.com\/ie\/wp-json\/wp\/v2\/posts\/507643","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.newsbeep.com\/ie\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.newsbeep.com\/ie\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/ie\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/ie\/wp-json\/wp\/v2\/comments?post=507643"}],"version-history":[{"count":0,"href":"https:\/\/www.newsbeep.com\/ie\/wp-json\/wp\/v2\/posts\/507643\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/ie\/wp-json\/wp\/v2\/media\/507644"}],"wp:attachment":[{"href":"https:\/\/www.newsbeep.com\/ie\/wp-json\/wp\/v2\/media?parent=507643"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.newsbeep.com\/ie\/wp-json\/wp\/v2\/categories?post=507643"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.newsbeep.com\/ie\/wp-json\/wp\/v2\/tags?post=507643"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}