{"id":24540,"date":"2021-02-17T11:15:58","date_gmt":"2021-02-17T18:15:58","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/aspnet\/?p=24540"},"modified":"2021-02-17T11:15:58","modified_gmt":"2021-02-17T18:15:58","slug":"asp-net-core-updates-in-net-6-preview-1","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/asp-net-core-updates-in-net-6-preview-1\/","title":{"rendered":"ASP.NET Core updates in .NET 6 Preview 1"},"content":{"rendered":"<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/announcing-net-6-preview-1\/\">.NET 6 Preview 1 is now available<\/a> and ready for evaluation. This is the first preview of .NET 6, the next major update to the .NET platform. .NET 6 is expected to ship in November of this year, and will be a <a href=\"https:\/\/dotnet.microsoft.com\/platform\/support\/policy\/dotnet-core\">Long Term Support (LTS)<\/a> release.<\/p>\n<p>If you&#8217;re on Windows using Visual Studio, we recommend <a href=\"https:\/\/visualstudio.com\/preview\">installing the latest preview of Visual Studio 2019 16.9<\/a>. If you&#8217;re on macOS, we recommend <a href=\"https:\/\/docs.microsoft.com\/visualstudio\/releasenotes\/vs2019-mac-preview-relnotes\">installing the latest preview of Visual Studio 2019 for Mac 8.9<\/a>.<\/p>\n<h2>Major work planned in ASP.NET Core in .NET 6<\/h2>\n<p>.NET 6 is using an open planning process, so you can see all of the major themes planned for this release on the Blazor-based <a href=\"https:\/\/themesof.net\">themesof.net<\/a> website. In addition to these top-level themes, we expect to deliver many user driven improvements to the platform as well. You can find a list of the major work planned for ASP.NET Core in .NET 6 in our <a href=\"https:\/\/github.com\/dotnet\/aspnetcore\/issues\/27883\">roadmap<\/a> issue. Here&#8217;s a sampling of some of the major ASP.NET Core features planned for the .NET 6 release:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/dotnet\/aspnetcore\/issues\/18486\">Hot reload<\/a>: Quickly make UI and code updates to running apps without losing app state for faster and more productive developer experience.<\/li>\n<li><a href=\"https:\/\/github.com\/dotnet\/aspnetcore\/issues\/27724\">Micro APIs<\/a>: Simplify building API endpoints with much less code and ceremony.<\/li>\n<li><a href=\"https:\/\/github.com\/dotnet\/aspnetcore\/issues\/27888\">Single-file publishing<\/a>: Build small, standalone, high-performance apps and services.<\/li>\n<li><a href=\"https:\/\/github.com\/dotnet\/aspnetcore\/issues\/5466\">WebAssembly ahead-of-time (AoT) compilation<\/a>: Compile .NET code in Blazor WebAssembly apps directly to WebAssembly when publishing for significantly improved runtime performance.<\/li>\n<li><a href=\"https:\/\/github.com\/dotnet\/aspnetcore\/issues\/27887\">Updated single-page app (SPA) support<\/a> Update SPA integration in ASP.NET Core to work seamlessly with the latest modern front-end JavaScript frameworks.<\/li>\n<li><a href=\"https:\/\/github.com\/dotnet\/aspnetcore\/issues\/27217\">Blazor hybrid desktop apps<\/a>: Combine the best of <a href=\"https:\/\/blazor.net\">Blazor<\/a> and <a href=\"https:\/\/devblogs.microsoft.com\/xamarin\/the-new-net-multi-platform-app-ui-maui\/\">.NET Multi-platform App UI<\/a> to build cross-platform hybrid desktop apps.<\/li>\n<li><a href=\"https:\/\/github.com\/dotnet\/aspnetcore\/issues\/15271\">HTTP\/3<\/a>: Add support for HTTP\/3 and QUIC in ASP.NET Core supported servers.<\/li>\n<\/ul>\n<p>We welcome feedback and participation in the planning and design process on GitHub.<\/p>\n<h2>What&#8217;s new in ASP.NET Core in .NET 6 Preview 1?<\/h2>\n<ul>\n<li>Support for <code>IAsyncDisposable<\/code> in MVC<\/li>\n<li><code>DynamicComponent<\/code><\/li>\n<li>Input <code>ElementReference<\/code> exposed on relevant components<\/li>\n<li><a href=\"https:\/\/github.com\/aspnet\/Announcements\/issues\/444\">Nullable reference type annotations<\/a><\/li>\n<\/ul>\n<h3>Get started<\/h3>\n<p>To get started with ASP.NET Core in .NET 6 Preview 1 <a href=\"https:\/\/dotnet.microsoft.com\/download\/dotnet-core\/6.0\">install the .NET 6 SDK<\/a>.<\/p>\n<h3>Upgrade an existing project<\/h3>\n<p>To upgrade an existing ASP.NET Core app from .NET 5 to .NET 6 Preview 1:<\/p>\n<ul>\n<li>Update the target framework for your app to <code>net6.0<\/code>.<\/li>\n<li>Update all Microsoft.AspNetCore.* package references to <code>6.0.0-preview.1.*<\/code>.<\/li>\n<li>Update all Microsoft.Extensions.* package references to <code>6.0.0-preview.1.*<\/code>.<\/li>\n<\/ul>\n<p>See the full list of <a href=\"https:\/\/docs.microsoft.com\/dotnet\/core\/compatibility\/6.0#aspnet-core\">breaking changes<\/a> in ASP.NET Core for .NET 6.<\/p>\n<h3>Support for <code>IAsyncDisposable<\/code> in MVC<\/h3>\n<p>You can now implement <code>IAsyncDisposable<\/code> on controllers, page models, and view components to asynchronously dispose of resources.<\/p>\n<h3><code>DynamicComponent<\/code><\/h3>\n<p><code>DynamicComponent<\/code> is a new built-in Blazor component that can be used to dynamically render a component specified by type.<\/p>\n<pre><code class=\"razor\">&lt;DynamicComponent Type=\"@someType\" \/&gt;\n<\/code><\/pre>\n<p>Parameters can be passed to the rendered component using a dictionary:<\/p>\n<pre><code class=\"razor\">&lt;DynamicComponent Type=\"@someType\" Parameters=\"@myDictionaryOfParameters\" \/&gt;\n\n@code {\n    Type someType = ...\n    IDictionary&lt;string, object&gt; myDictionaryOfParameters = ...\n}\n<\/code><\/pre>\n<h3>Input <code>ElementReference<\/code> exposed on relevant components<\/h3>\n<p>The relevant built-in input Blazor components now expose a convenient <code>ElementReference<\/code> to the underlying input, which simplifies common scenarios like setting the UI focus on the input. The affected components are <code>InputCheckbox<\/code>, <code>InputDate<\/code>, <code>InputFile<\/code>, <code>InputNumber<\/code>, <code>InputSelect<\/code>, <code>InputText<\/code>, and <code>InputTextArea<\/code>.<\/p>\n<h3>Nullable Reference Type Annotations<\/h3>\n<p>We have been applying nullability annotations to parts of ASP.NET Core. A significant number of new APIs were annotated in .NET 6 Preview 1.<\/p>\n<p>By utilizing the new feature in C# 8, ASP.NET Core can provide additional compile-time safety in the handling of reference types like protecting against null reference exceptions. Projects that have opted in to using nullable annotationes may see new build-time warnings from ASP.NET Core APIs.<\/p>\n<p>To enable nullable reference types, you can add the following property to your project file:<\/p>\n<pre><code class=\"xml\">&lt;PropertyGroup&gt;\n    &lt;Nullable&gt;enable&lt;\/Nullable&gt;\n&lt;\/PropertyGroup&gt;\n<\/code><\/pre>\n<p>For more information, see <a href=\"https:\/\/docs.microsoft.com\/dotnet\/csharp\/nullable-references\">Nullable reference types<\/a>.<\/p>\n<h2>Give feedback<\/h2>\n<p>We hope you enjoy this first preview release of ASP.NET Core in .NET 6. We are eager to hear about your experiences with this release. Let us know what you think by filing issues on <a href=\"https:\/\/github.com\/dotnet\/aspnetcore\/issues\">GitHub<\/a>.<\/p>\n<p>Thanks for trying out ASP.NET Core!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>.NET 6 Preview 1 is now available and ready for evaluation. This is the first preview of .NET 6, the next major update to the .NET platform. .NET 6 is expected to ship in November of this year, and will be a Long Term Support (LTS) release. If you&#8217;re on Windows using Visual Studio, we [&hellip;]<\/p>\n","protected":false},"author":1233,"featured_media":58792,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[197],"tags":[],"class_list":["post-24540","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aspnet"],"acf":[],"blog_post_summary":"<p>.NET 6 Preview 1 is now available and ready for evaluation. This is the first preview of .NET 6, the next major update to the .NET platform. .NET 6 is expected to ship in November of this year, and will be a Long Term Support (LTS) release. If you&#8217;re on Windows using Visual Studio, we [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/24540","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/1233"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=24540"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/24540\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/58792"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=24540"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=24540"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=24540"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}