ASP.NET Core updates in .NET 6 Preview 1 #352
Smilefounder
started this conversation in
News
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
ASP.NET Core updates in .NET 6 Preview 1
Major work planned in ASP.NET Core in .NET 6
.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 themesof.net 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 roadmap issue. Here’s a sampling of some of the major ASP.NET Core features planned for the .NET 6 release:
We welcome feedback and participation in the planning and design process on GitHub.
What’s new in ASP.NET Core in .NET 6 Preview 1?
IAsyncDisposable
in MVCDynamicComponent
ElementReference
exposed on relevant componentsdotnet watch
now doesdotnet watch run
by defaultGet started
To get started with ASP.NET Core in .NET 6 Preview 1 install the .NET 6 SDK.
Upgrade an existing project
To upgrade an existing ASP.NET Core app from .NET 5 to .NET 6 Preview 1:
net6.0
.6.0.0-preview.1.*
.6.0.0-preview.1.*
.See the full list of breaking changes in ASP.NET Core for .NET 6.
Support for
IAsyncDisposable
in MVCYou can now implement
IAsyncDisposable
on controllers, page models, and view components to asynchronously dispose of resources.DynamicComponent
DynamicComponent
is a new built-in Blazor component that can be used to dynamically render a component specified by type.Parameters can be passed to the rendered component using a dictionary:
Input
ElementReference
exposed on relevant componentsThe relevant built-in input Blazor components now expose a convenient
ElementReference
to the underlying input, which simplifies common scenarios like setting the UI focus on the input. The affected components areInputCheckbox
,InputDate
,InputFile
,InputNumber
,InputSelect
,InputText
, andInputTextArea
.dotnet watch
now doesdotnet watch run
by defaultRunning
dotnet watch
will now rundotnet watch run
default, saving on precious typing time.Nullable Reference Type Annotations
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.
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.
To enable nullable reference types, you can add the following property to your project file:
For more information, see Nullable reference types.
.NET 6.0.0 Preview 1 - February 17, 2021
The .NET 6.0.0 Preview 1 and .NET SDK 6.0.100-preview.1.21103.13 releases are available for download. The latest 6.0 release is always listed at .NET 6.0 Releases.
What's new in .NET 6 Preview 1
.NET 6 is the next major release of .NET following .NET 5.0. You can see some of the new features available with .NET 6 Preview 1 at dotnet/core #5853.
See the .NET, EF Core and ASP.NET Core blogs for additional details.
Here is list of some of the additions and updates we're excited to bring in Preview 1.
Downloads
Hosting Bundle2
The .NET SDK includes a matching updated .NET Runtime. Downloading the Runtime or ASP.NET Core packages is not needed when installing the SDK.
You can check your .NET SDK version by running the following command. The example version shown is for this release.
Mobile Workload Downloads
.NET 6 introduces Android and iOS SDKs for developing native mobile applications. These provide the foundational mobile pieces for the new .NET Multi-platform App UI. See dotnet/net6-mobile-samples for additional setup instructions and sample mobile projects you can run today.
Visit .NET Documentation to learn about .NET, for building many different types of applications.
Docker Images
The .NET Docker images have been updated for this release. The .NET Docker samples show various ways to use .NET and Docker together. You can use the following command to try running the latest .NET 6.0 release in containers:
docker run --rm mcr.microsoft.com/dotnet/samples
The following repos have been updated.
Visual Studio Compatibility
You need Visual Studio 16.9 Preview 4 or later to use .NET 6.0 on Windows. On macOS, you need the latest version of Visual Studio for Mac. The C# extension for Visual Studio Code supports .NET 6.0 and C# 9.
Feedback
Your feedback is important and appreciated. We've created an issue at dotnet/core #5967 for your questions and comments.
Beta Was this translation helpful? Give feedback.
All reactions