How to download and install .NET 8 and C# 12
Published: Tuesday 14 November 2023
The long awaited release of .NET 8 and C# 12 has finally happened!
Update Visual Studio 2022
In-order to use .NET 8, Visual Studio 2022 needs to be updated to version 17.8.0 or above.
Update Visual Studio 2022 to 17.8.0
Install the .NET 8 SDK
Updating Visual Studio should automatically install the .NET 8 SDK.
Download the .NET 8 SDK
To check whether the SDK is installed, this command line can be run:
dotnet --list-sdks
This will output all the SDK's installed on the machine. If version 8.0.100 or above appears, .NET 8 is installed.
Using .NET 8 in a Visual Studio project
To create a new .NET 8 project in Visual Studio, go to File, New and Project in the top-left hand corner of the screen.
Create a .NET 8 project in Visual Studio
To use .NET 8 in a current project, edit the .csproj file and ensure that the TargetFramework in the PropertyGroup tag is set to net8.0.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
...
</PropertyGroup>
...
</Project>
.NET 8 and C# 12 features
.NET 8 and C# 12 has many new and exciting features that includes:
- Primary constructors
- Collection expressions
- Keyed services
- Mocking time with TimeProvider
- SSR in Blazor
- Render mode for Server & WebAssembly Blazor components
Watch the video
Watch our video where we demonstrate how to update Visual Studio and how to download the .NET 8 SDK.
Related pages
.NET 9 has been released and this is how you update
Find out how you can update your ASP.NET Core application to .NET 9 from updating Visual Studio, downloading the SDK and finding out about breaking changes.