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!

We'll demonstrate how to update Visual Studio, download the .NET 8 SDK and how to start using .NET 8 in a project.

C# coding challenges

C# coding challenges

Our online code editor allows you to compile the answer.

As a bonus, we'll also show how to get a list of all the SDK's installed.

Update Visual Studio 2022

In-order to use .NET 8, Visual Studio 2022 needs to be updated to version 17.8.0 or above.

To do that, go to Help in the top-left hand corner of the screen and go to Check for Updates.

If there is an update available, it will be shown on the screen.

Update Visual Studio 2022 to 17.8.0

Update Visual Studio 2022 to 17.8.0

Install the .NET 8 SDK

Updating Visual Studio should automatically install the .NET 8 SDK.

However, users that don't use Visual Studio will need to download the .NET 8 SDK from Microsoft's website.

Download 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.

Select which project to create then go through the steps until the Framework choice appears.

.NET 8 should be selected by default as the framework.

Create a .NET 8 project in Visual Studio

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:

Watch the video

Watch our video where we demonstrate how to update Visual Studio and how to download the .NET 8 SDK.

As a bonus, we'll also cover how Keyed Services work in .NET 8.