.NET is a cross-platform open-source development platform that supports the coding languages C#, F#, and Visual Basic. .NET 7 is the current release of .NET, meaning it will receive support for the next 18 months from Microsoft.
Since it is still in the preview state, Microsoft has released .NET 7 Preview 4, which is the 4th update for .NET 7. However, you can still download and install it on your compatible devices using the direct download links shared below. .NET 7 can be installed on the following platforms:
.NET 7 Preview 4 has been tested with Visual Studio 17.3 Preview 1, thus Microsoft recommends that you use it with preview channel releases of Visual Studio only to avoid compatibility conflicts.
Note: Visual Studio for Mac support for .NET 7 preview release is not yet available, but Microsoft says it will be coming soon.
Let us now dig into the new improvements this release has to offer.
This release includes enhancements to the following components of .NET:
- Microsoft has finished annotating the
Microsoft.Extensions.*libraries for nullability.
- Updated TimeStamp, DateTime, DateTimeOffset, and TimeOnly.
- Added new TAR APIs.
- On Stack Replacement (OSR)
Let’s discuss a few of these in detail.
New in .NET 7 Preview 4
Improvements to Observability
A series of improvements to support observability in .NET 7 via OpenTelemetry, Microsoft has made a few improvements to the different components.
They introduced a
Activity.Current change event which can be used instead to receive the desired notifications instead of the
Furthermore, developers can now use exposed methods that can be used in performance-critical scenarios to enumerate Activity Tags, Links, and Events properties without any extra allocations and with quicker accessing times.
Updated TimeStamp, DateTime, DateTimeOffset, TimeOnly
Previously, the lowest increment of time available in the various date and time structures was the “tick”, where a single tick is 100 nanoseconds (ns).
Currently, Microsoft has added increments of microseconds and nanoseconds to TimeStamp, DateTime, DateTimeOffset, and TimeOnly.
New TAR APIs
Microsoft has added a new
System.Formats.Tar assembly. This new assembly contains cross-platform APIs that allow reading, writing, archiving, and extracting of Tar archives.
It offers variants that allow extracting from a stream or archiving into a stream. Moreover, the entries of an archive can be traversed one by one using the reader, and they can also be written one by one into an archive stream using the writer.
On Stack Replacement (OSR)
OSR allows the runtime to change the code executed by currently running methods in the middle of method execution, while those methods are active “on stack.” It serves as a complement to the tiered compilation.
This feature significantly improves startup time. According to Microsoft’s analysis, OSR helped to improve the startup time in jitting-heavy applications like Avalonia “IL” spy by 25 percent.
Download .NET 7 Preview 4
Use the direct download links below to download the .NET 7 Preview 4 Runtime, SDKs, and ASP.NET Core matching your operating system and architecture:
More download and install options here.
Install .NET 7 Preview 4
You can begin by downloading .NET 7 Preview 4 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 3. You may check which .NET version is running by typing in the following command in Command Prompt:
wmic product get description | findstr /C:.NET
The last preview release for .NET 7, which was .NET 7 Preview 3, was released nearly 4 weeks ago. This indicates that Microsoft is working round the clock to improve the .NET platform and make the necessary changes before launching it publicly.
That being said, since this release is still in its preview, we do not recommend that you install it in a production environment. Rather, we suggest you use it in test environments only and check out the new improvements and compatibility with your existing and new applications.