.NET 6 is now released! ASP.NET Core in .NET 6 includes everything you need to build rich modern web UI and powerful back-end services.
What’s new?
Here’s a sampling of the great new features and improvements in ASP.NET Core for .NET 6:
- Hot reload: Apply changes to Razor, C#, and CSS source files into your running app during development without the need to rebuild and restart the app.
- Minimal APIs: Create a new ASP.NET Core app with just a few lines of code using the latest C# features and a simplified hosting model.
- Async streaming: Asynchronously stream data from the server without any need for buffering.
- IAsyncDisposable: Support for
IAsyncDisposable
on controllers, page models, and view components. - Bootstrap 5.1: ASP.NET Core now comes with integrated Bootstrap 5.1 support.
- Null-state analysis: All ASP.NET Core templates now have C# null-state analysis enabled by default.
- CSS isolation for pages and views: Scope CSS styles to specific pages or views using .cshtml.css files.
- JavaScript modules: Place related JavaScript modules alongside pages, views, and components using .cshtml.js and .razor.js files.
- Blazor improvements:
- .NET WebAssembly build tools: Ahead-of-time (AOT) compilation for Blazor WebAssembly apps, as well as support for runtime relinking and native dependencies.
- Single-page apps: Built-in support for Angular 12 and React 17 based on a flexible template pattern that can be used with other popular frontend JavaScript frameworks.
- Socket control: More control over socket creation and handling.
- Strongly-typed headers: Accessing HTTP headers in a strongly-typed way.
- HTTP & W3C logging: Log HTTP traffic, and log using the W3C Extended Log File Format.
- HTTP/3 (Preview): Preview of server support for HTTP/3 based on the new QUIC transport.
For a full list of everything that’s new in ASP.NET Core in .NET 6, check out the ASP.NET Core in .NET 6 release notes.
Get started
To get started with ASP.NET Core in .NET 6, install the .NET 6 SDK. .NET 6 is also included with Visual Studio 2022. Mac users should use the latest Visual Studio 2022 for Mac preview.
Upgrade an existing project
To upgrade an existing ASP.NET Core app from .NET 5 to .NET 6, follow the steps in Migrate from ASP.NET Core 5.0 to 6.0
To upgrade an existing ASP.NET Core app from .NET 6 RC2 to .NET 6, update all package references to 6.0.0
.
That’s it! You should be all set to enjoy the benefits of .NET 6.
See also the full list of breaking changes in ASP.NET Core for .NET 6.
Join us for the .NET 6 release at .NET Conf 2021
Come celebrate with us and learn all about the .NET 6 release at .NET Conf 2021, a FREE, three day virtual developer event with over 80 sessions featuring speakers from the .NET team and the broader .NET community. The conference starts tomorrow and goes from November 9-11. We hope you can join us!
Azure Functions, Web Apps, and Static Web Apps support .NET 6
Azure App Service teams have been working around the clock to make sure .NET 6 is supported across your favorite Azure PaaS services like Web Apps and Functions, so you don’t have to wait to deploy. At the time of this post, .NET 6 is being actively deployed to the worldwide network of servers and configured to build and run .NET 6 apps.
For more information on the various Azure services and their roll-out of supporting .NET 6, which should conclude by the end of this week, see the following links:
- Azure Functions now supports running serverless functions in .NET 6
- The App Service .NET 6 GA Announcement has information and details for ASP.NET Core developers excited to get going with .NET 6 today. One thing to note – if you’re already running a .NET 6 preview build on App Service, your app will be auto-updated on the first restart once the .NET 6 runtime and SDK are deployed to your region – you don’t have to rebuild or do anything, it’ll just update if you’re not running a self-contained app.
- Azure Static Web Apps now supports full-stack .NET 6 applications with Blazor WebAssembly frontends and Azure Function APIs
We’re sure you’ll enjoy the immediate availability of Azure App Service to run your ASP.NET Core and Serverless .NET apps. And don’t forget to try using Azure Container Apps if you’re keen on building some background microservices using the .NET Core Worker Service template, too.
Thank you!
Thank you to everyone in the community who helped make this release of .NET 6 possible! This release represents the culmination of many GitHub issues, pull requests, design feedback comments and documentation updates contributed by many members of the .NET community. We couldn’t have made it to this point without you!
We hope you enjoy this release of ASP.NET Core in .NET 6. We’re eager to hear about your experiences building with it. Let us know about your creative efforts on GitHub.
Thanks again, and happy coding!
Can MAUI be defined as a Blazor hosting model?
Like Blazor WebAssembly and Blazor Server.
.NET MAUI supports hosting Blazor components using a BlazorWebView control. The Blazor components run directly in the .NET MAUI app and then render to an embedded web view through a local interop channel. WebAssembly is not involved. We call this hosting model Blazor Hybrid and it can be applied to other native client apps as well, like WPF and Windows Forms apps.
If ever there was any doubt about Microsoft's long term commitment to Blazor, DotNETConf '21 blew it away. I was awed by the length and breadth of it all.
For me there remain two facets which I believe still need to be addressed. I'll put my hand up in the air and say I'm a professional who primarily works in a non-IT industry, but I have a couple of (now dated) apps that I wrote (WinForms...
ASP.NET 6 looks like a great release, kudos to the team and people involved!
2 questions comes to mind on changes here:
“Hot reload: Apply changes to Razor, C#, and CSS source files into your running app during development without the need to rebuild and restart the app.”
Does the “C#” means hot reload works on .cs files (e.g. controller and model classes)?
Yup, that’s correct.
Thank you very much!
Thanks for the release.
We had built Blazor Webassembly application, now upgraded to 6.0, problem is app takes 200MB of ram on startup in normal mode,
but in AOT it takes more than 2GB of ram, is it expected or any configuration is there to change?
Hi Manoj. If you haven’t already, please open a GitHub issue with details about the memory consumption issue you are seeing, and we’ll take a look: https://github.com/dotnet/runtime/issues/new.
Looking forward to running Web Forms on .NET 7.
No migration manual from 3.1 to 6?
We’d like to see this as well. I think a lot of companies probably skipped .NET 5 and are wanting to migrate .NET Core 3.1 to .NET 6 🙂
We’ve added a migration doc for moving ASP.NET Core apps from .NET Core 3.1 to .NET 6 LTS: https://docs.microsoft.com/aspnet/core/migration/31-to-60. I hope this helps!
I would like to thank the entire team for your great work on ASP.NET Core. In particular, Blazor WASM has become truly outstanding. We have been developing a complex business app with Blazor WASM for more than a year and are extremely satisfied. It's an innovation that adds great value to the .NET ecosystem. It's great to see that Blazor app now runs even faster and compilation has been sped up. Keep up the good...
Look forward to using .Net 6 with Azure functions, and getting better safety with NRT support.
AOT for blazor has made good progress but isn't yet complete as only partial AOT is done. Completing it is tracked here: https://github.com/dotnet/aspnetcore/issues/35302 ("Still downloading Dlls"). It's not clear that the Microsoft ASP.Net group views full AOT as important so it may be that AOT support ends up coming from the NativeAOT side (i.e. using CoreCLR) rather than the more...