-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Tools and Skills for .NET 8
By :

Microsoft will release .NET 9 at the .NET Conf 2024 on Tuesday, November 12, 2024, one week after the US Presidential election on November 5. Many readers will want to use this book with .NET 9, so this section explains how.
At the time of publishing in July 2024, .NET 9 is already available in preview, or you can wait for the final version in November 2024. But beware because once you install a .NET 9 SDK, then it will be used by default for all .NET projects unless you override it using a global.json
file. You can learn more about doing this at the following link: https://learn.microsoft.com/en-us/dotnet/core/tools/global-json.
You can easily continue to target the .NET 8 runtime while installing and using future C# compilers, as shown in Figure 1.4 and illustrated in the following list:
Figure 1.4: Targeting .NET 8 for long-term support while using the latest C# compilers
When deciding to install a .NET SDK, remember that the latest is used by default to build any .NET projects. Once you’ve installed a .NET 9 SDK preview, it will be used by default for all projects, unless you force the use of an older, fully supported SDK version like 8.0.100 or a later patch.
To gain the benefits of whatever new features are available in C# 13, while still targeting .NET 8 for long-term support, modify your project file, as shown highlighted in the following markup:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>13</LangVersion> <!--Requires .NET 9 SDK GA-->
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>
Good Practice
Use a general availability (GA) SDK release like .NET 9 to use new compiler features while still targeting older but longer supported versions of .NET like .NET 8.