.NET 8 will replace .NET 6 in the Long Term Support (LTS) channel which is said to be supported for 3 years after its initial release. Currently, its preview version is available to download which is now Preview 4. Most likely, .NET 8 will have additional 4 preview releases and 2 Release Candidates before its first stable release expected in November 2023. .NET 8 Preview 4 has been tested with Visual Studio 2022 version 17.7 Preview 1. Therefore, it is recommended that you use the same VS version. Let us now see what’s new in .NET 8 before moving on to downloading the Runtimes, SDKs, and the ASP.NET Cores.

What’s New in .NET 8

There is a long list of features and improvements in .NET 8. We have highlighted the significant ones for you here:

Features and Improvements in .NET 8 Preview 4

There are a plethora of improvements and new features introduced with .NET 8 Preview 4. The sections below list a few.

New Terminal Build Output

Microsoft has introduced its first iteration of the default MSBuild output logging, and calling it the “Terminal Logger.” Users previously complained that the default output logger is static, difficult to parse and often encounters errors. Therefore, Microsoft has now introduced a modern version of it. Here is a list of the goals accomplished by this update:

Logically group errors with the project they belong with Present projects/builds in a way that users think of the build (especially multi-targeted projects) Better differentiate the TargetFrameworks a project builds for Continue to provide at-a-glance information about the outputs of a project Provide information about what the build is doing right now over the course of a build.

To learn more about the new terminal build output, refer to this Microsoft guide post.

Changes to Simplified Output Path

A few changes have been made to the simplified output path, that was released with Preview 3. Here are the changes:

The default path for the new layout is changing from .artifacts to artifacts The ability to use the feature from Project files instead of Directory.Build.props is removed. It is now easier to get started with the feature by including the required properties as an option on the buildprops template for dotnet new.

To learn more about the new changes, refer to this Microsoft guide post.

Integration of Nuget Security Features into Template Engine

Microsoft is now integrating several of NuGet.org’s security-related features into the Template Engine. Here is a list of these improvements:

Prevent downloading packages from http:\ feeds, but allow overrides with the –force flag Notify a customer if a template package has any vulnerabilities on install/update/outdated checks, and require –force to install vulnerable versions Add data to the search and uninstall commands that shows if a template is installed from a package that has a prefix reserved in NuGet.org Add information about the template package owner. The ownership is verified by nuget portal and can be considered a trustworthy characteristic.

Other Features and Improvements

As we mentioned earlier, there is a huge list of improvements in .NET 8 Preview 4. Click on the given links below to learn more about them:

NuGet: signed package verification on Linux NuGet: Auditing package dependencies for security vulnerabilities Enabling security auditing Libraries: UTF8 improvements Time abstraction Native AOT improvements System.Text.Json Improvements

Features and Improvements in .NET 8 Preview 3

Improvements to SDK

There are several improvements made to the SDK packages for .NET 8 Preview 3:

Simplified output path Microsoft has now introduced an option that lets you create a more unified, simplified output path structure. Previously, users had to use difficult and complex structures for creating output paths, that required them to engrave the many different permutations and arrangements of folders like “bin,” “obj,” and “publish” into their muscle memory. Based on the user’s feedback, this approach was: Difficult to use because the layout can change drastically via relatively simple MSBuild changes. Difficult for tools to anticipate because the per-project layout makes it hard to be sure that you’ve gotten the outputs for every project. For these reasons, Microsoft introduced a new output path that focuses on the following: Gathering all of the build outputs in a common location. Separating the build outputs by project under this common location. Flattening the overall build output layouts to a maximum of three levels deep To learn how to use this new output path, refer to this guide by Microsoft. Clean workload directories You can now clean out the workload directories, instead of doing the job manually, by using the following command: dotnet workload clean

Improvements to the Runtime Libraries

ValidateOptionsResultBuilder This new tool allows you to save time and effort by streamlining the validation process. The ValidateOptionsResultBuilder makes it easier to create of a ValidateOptionsResult object, which is required to implement IValidateOptions.Validate(String, TOptions). Configuration binding source generator .NET 8 is now using a source generator that generates reflection-free and AOT-friendly binding implementations. The approach currently being used uses reflection which causes issues for trimming and Native AOT, since the manual process is both rigorous and time-consuming. Native code generation The following improvements were made to the JIT compiler ARM64 Profile guided optimization General optimizations

Improvements to Containers

The following improvements were made to the .NET 8 containers: Microsoft has now introduced an option that lets you create a more unified, simplified output path structure. Previously, users had to use difficult and complex structures for creating output paths, that required them to engrave the many different permutations and arrangements of folders like “bin,” “obj,” and “publish” into their muscle memory. Based on the user’s feedback, this approach was:

Difficult to use because the layout can change drastically via relatively simple MSBuild changes. Difficult for tools to anticipate because the per-project layout makes it hard to be sure that you’ve gotten the outputs for every project.

For these reasons, Microsoft introduced a new output path that focuses on the following:

Gathering all of the build outputs in a common location. Separating the build outputs by project under this common location. Flattening the overall build output layouts to a maximum of three levels deep

To learn how to use this new output path, refer to this guide by Microsoft. You can now clean out the workload directories, instead of doing the job manually, by using the following command: This new tool allows you to save time and effort by streamlining the validation process. The ValidateOptionsResultBuilder makes it easier to create of a ValidateOptionsResult object, which is required to implement IValidateOptions.Validate(String, TOptions). .NET 8 is now using a source generator that generates reflection-free and AOT-friendly binding implementations. The approach currently being used uses reflection which causes issues for trimming and Native AOT, since the manual process is both rigorous and time-consuming. The following improvements were made to the JIT compiler

ARM64 Profile guided optimization General optimizations

Building multi-platform container images Docker now supports using and building multi-platform images that work across multiple environments. Microsoft has developed a new pattern that enables you to mix and match architectures with the .NET images that you build. To learn how to achieve multi-platform compatibility, refer to this Microsoft post. Environment Variable for non-root user UID value An environment variable is now added for the UID for the non-root user that was added in .NET 8 Preview 1. The Kubernetes runAsNonRoot test required that the container user be set via UID, not a name. At the same time, we wanted to avoid developers needing to apply a special number across (collectively) thousands of Dockerfiles. Instead, Microsoft is now exposing that value — 64198 — in an environment variable.

To learn more about what’s new in .NET 8 Preview 3, read this announcement by Microsoft. Docker now supports using and building multi-platform images that work across multiple environments. Microsoft has developed a new pattern that enables you to mix and match architectures with the .NET images that you build. To learn how to achieve multi-platform compatibility, refer to this Microsoft post. An environment variable is now added for the UID for the non-root user that was added in .NET 8 Preview 1. The Kubernetes runAsNonRoot test required that the container user be set via UID, not a name. At the same time, we wanted to avoid developers needing to apply a special number across (collectively) thousands of Dockerfiles. Instead, Microsoft is now exposing that value — 64198 — in an environment variable.

Features and Improvements in .NET 8 Preview 2

Introduction of Extensions to Built-in Validation Attributes

Microsoft has introduced extensions to the built-in validation attributes in system.ComponentModel.DataAnnotations. The following extensions have been announced:

RequiredAttribute.DisallowAllDefaultValues – Allows validating that structs do not equal their default values. RangeAttribute exclusive bounds – Users can now specify exclusive bounds in their range validation. LengthAttribute – Can be used to set both lower and upper bounds for strings or collections. AllowedValuesAttribute and DeniedValuesAttribute – These attributes can be used to specify allow lists and deny lists for validating a property, respectively. Base64StringAttribute – This attribute validates that a given string is a valid Base64 representation.

Introspection support for function pointers

Function pointers were previously added to .NET 5. However, Microsoft didn’t add a matching experience for the feature in Reflection. Now, System.Reflection has been added. This new feature adds the capability to obtain function pointer metadata via Reflection, including parameter types, return types, and calling conventions. Previously, the IntPtr type was used for a function pointer type such as with typeof(delegate*()) or when obtaining a function pointer type through reflection such as with FieldInfo.FieldType. These are the only features introduced with .NET 8 Preview 2. To learn more about what’s new in this release, read this announcement by Microsoft.

Features and Improvements in .NET 8 Preview 1

Native Ahead-Of-Time (AOT) Compilation

The performance of.NET apps and programs can be significantly improved by using Ahead-of-Time (AOT) compilation. Since everything is included in a single file when publishing an app with Native AOT, the resulting version of your program is entirely self-contained and does not require a separate runtime. This single file is now smaller than ever. Modern Linux builds can now be up to half their actual size. Although this feature was previously included in .NET 7, it has now also been supported for macOS.

Improvements to .NET Container Images

Using container images, .NET developers can package and distribute their applications in a portable, lightweight format that runs in a variety of settings and is simple to upload to the cloud. Microsoft has now updated the following container images:

The default Linux distro has been updated to Debian 12 The container images will now be using Debian 12 as the default distro. To give their users plenty of time for the transition, this change has been implemented with the first preview of .NET 8. Run container images with non-root users Previously, all container images had to be run with the “root” user, which could cause inconvenience. Now, all container images published by Microsoft will be non-root capable.

Other Improvements in .NET 8 Preview 1

Some other improvements have also been made in .NET 8 to different components. To learn more about each one, click on the item below: The container images will now be using Debian 12 as the default distro. To give their users plenty of time for the transition, this change has been implemented with the first preview of .NET 8. Previously, all container images had to be run with the “root” user, which could cause inconvenience. Now, all container images published by Microsoft will be non-root capable.

Improvements to Runtime Libraries JSON improvements New performance-focused types in Core Libraries

To learn more about what’s new in .NET 8 Preview 1, read this announcement by Microsoft.

Download .NET 8 Preview 4

Use the direct download links below to download the .NET 8 Preview 4 Runtime, SDKs, and ASP.NET Core matching your operating system and architecture.

Runtime

Download .NET 8 Preview 4 Desktop Runtime for Windows x64 Download .NET 8 Preview 4 Desktop Runtime for Windows x86 Download .NET 8 Preview 4 Desktop Runtime for Windows ARM64 Download .NET 8 Preview 4 Runtime for macOS x64 Download .NET 8 Preview 4 Runtime for macOS ARM64 Download .NET 8 Preview 4 Runtime Binaries for Linux Arm32 Download .NET 8 Preview 4 Runtime Binaries for Linux Arm64 Download .NET 8 Preview 4 Runtime Binaries for Linux Arm32 Alpine Download .NET 8 Preview 4 Runtime Binaries for Linux Arm64 Alpine Download .NET 8 Preview 4 Runtime Binaries for Linux x64 Download .NET 8 Preview 4 Runtime Binaries for Linux x64 Alpine

SDK

Download .NET SDK 8.0.100 Preview 4 for Windows x64 Download .NET SDK 8.0.100 Preview 4 for Windows x86 Download .NET SDK 8.0.100 Preview 4 for Windows ARM64 Download .NET SDK 8.0.100 Preview 4 for macOS x64 Download .NET SDK 8.0.100 Preview 4 for macOS ARM64 Download .NET SDK 8.0.100 Preview 4 Binaries for Linux Arm32 Download .NET SDK 8.0.100 Preview 4 Binaries for Linux Arm64 Download .NET SDK 8.0.100 Preview 4 Binaries for Linux Arm32 Alpine Download .NET SDK 8.0.100 Preview 4 Binaries for Linux Arm64 Alpine Download .NET SDK 8.0.100 Preview 4 Binaries for Linux x64 Download .NET SDK 8.0.100 Preview 4 Binaries for Linux x64 Alpine

ASP.NET Core

Download ASP.NET Core Runtime 8 Preview 4 Hosting Bundle for Windows Download ASP.NET Core Runtime 8 Preview 4 for Windows x64 Download ASP.NET Core Runtime 8 Preview 4 for Windows x86 Download ASP.NET Core Runtime 8 Preview 4 Binaries for Windows ARM64 Download ASP.NET Core Runtime 8 Preview 4 Binaries for macOS x64 Download ASP.NET Core Runtime 8 Preview 4 Binaries for macOS ARM64 Download ASP.NET Core Runtime 8 Preview 4 Binaries for Linux Arm32 Download ASP.NET Core Runtime 8 Preview 4 Binaries for Linux Arm64 Download ASP.NET Core Runtime 8 Preview 4 Binaries for Linux Arm32 Alpine Download ASP.NET Core Runtime 8 Preview 4 Binaries for Linux Arm64 Alpine Download ASP.NET Core Runtime 8 Preview 4 Binaries for Linux x64 Download ASP.NET Core Runtime 8 Preview 4 Binaries for Linux x64 Alpine More download and install options for .NET 8 here.

Install .NET 8

You can begin by downloading the right .NET version for you from the links above and then running it to begin the installation process. Here is how: Once you have installed the newer .NET preview version, all your applications will run using the new build as the previous preview version will be replaced. However, if a stable version is installed and running, it will not be replaced. You have now installed the .NET. You may check which .NET version is running by running the following command in Command Prompt: 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.

How to Remove/Uninstall .NET

If you wish to remove a .NET version from your computer, you can simply uninstall it like any other regular application. Here are the steps to following:

Conclusion

At the time of writing this post, .NET 7.0.5 was the latest Standard Support stable release for .NET, and .NET 6.0.16 was the stable LTS release. We recommend that you stay on these (or later stable releases) for your production environments. The uninstallation wizard will now launch. However, for testing purposes, you can install .NET 8 Preview from the links shared above and try out what’s new today.

.NET 8 Release History