After nearly a month’s gap, .NET 7 Preview 2 has been released by Microsoft for you to test and try out. This release focuses on RegEx source generators and other improvements to the “dotnet new” Command Line Interface (CLI) experience.
If you are willing to try out the new features, you can download the runtimes, SDKs, and the ASP .NET Core from the direct download links given below for the following operating systems:
But before you do, we suggest you read through the new features highlighted below.
Table of contents
New in .NET 7 Preview 2
Since .NET 7 is the current release of .NET, it will receive free support and patches from Microsoft for the next 18 months.
In terms of operating systems, this release will be compatible with the following architectures on Red Hat Enterprise Linux (RHEL) version 8:
- AMD x64
- Intel x64
- ARM (aarch64)
- IBM Z
- LinuxONE (s390x)
RegEx Source Generator
The RegEx source generator was first introduced in .NET 7 Preview 1. It is a RegEx engine optimized for your particular pattern, just without the overhead of having to build the engine at runtime.
It brings all of the performance benefits from the compiled engine without the startup cost, and it also has additional benefits, like providing a great debugging experience as well as being trimming-friendly.
To learn how to use this feature, refer to this Microsoft post.
All of the commands in the “
dotnet new --help” output no longer have the “
--” prefix that they do today. This is more in line with what users expect from subcommands in a CLI application.
There are many other improvements in .NET 7 Preview 2. If you want to read more, refer to this Microsoft blog post.
Download .NET 7 Preview 2
Use the direct download links below to download the .NET 7 Preview 2 Runtime, SDKs, and ASP.NET Core matching your operating system and architecture:
More download and install options here.
Install .NET 7 Preview 2
You can begin by downloading .NET 7 Preview 2 for your architecture from the links above and then execute it to begin the installation process.
- Run the installation package by double-clicking it (in the case of macOS and Windows), and then clicking Install on the installation wizard.
- The installation will now begin. It does not take much time nor does it require a restart. Click Close once it has been installed successfully.
You have now installed .NET 7 Preview 1. You may check which .NET version is running by typing in the following command in Command Prompt:
wmic product get description | findstr /C:.NET
Since this is a preview release, it might not be entirely stable. Therefore we suggest that you only install it on non-production environments until the stable release.
For now, it can be used with Visual Studio 17.2 Preview 1 since Microsoft has already tested its compatibility.