.NET 8 Preview 2: early upgrade testing starts now
Posted: (EET/GMT+2)
Microsoft has released .NET 8 Preview 2, giving developers another early build of the next .NET Long-Term Support (LTS) release.
At this stage, the practical value is early compatibility testing. If you maintain libraries, build pipelines, or ASP.NET Core applications, now is a good time to test a branch.
For an existing .NET application you want to test with .NET 8, start by creating a new version control branch and then update the target framework in the .csproj file:
<TargetFramework>net8.0</TargetFramework>
Then restore, build, and run tests (or use Visual Studio for that):
dotnet restore dotnet build dotnet test
If you need to keep the preview isolated, add a global.json file:
dotnet new globaljson
Then set the SDK version explicitly:
{
"sdk": {
"version": "8.0.100-preview.2"
}
}
Good things to test early:
- NuGet package compatibility
- source generators
- analyzers
- container builds
- CI pipelines
- ASP.NET Core startup and middleware.
With preview versions, the goal is not to finish the migration in March. The goal is to discover blockers while there is still time before the final release.
Tip: take a look at the System.ComponentModel.DataAnnotations extensions in this version. Very handy!