Skip to content
Knowledge Base
Česky

ASP.NET Core · Development Tools

Slow .NET builds/tests? An installed preview SDK might be the culprit

Robert Haken 1 min read Markdown ↓

If you have a .NET preview SDK installed on your machine (for example, the .NET 11 preview), the dotnet CLI may default to it — and in my case (apparently due to a bug in the preview), this caused builds and tests to run significantly slower than with the release SDK. It also shows up with AI coding agents that invoke dotnet from the command line.

The fix is to add a global.json to the solution root that opts out of preview SDKs:

{
"sdk": {
"version": "10.0.0",
"allowPrerelease": false,
"rollForward": "latestFeature"
},
"test": {
"runner": "Microsoft.Testing.Platform"
}
}

The key bit is allowPrerelease: false — dotnet will skip the preview SDK and pick the release one. Adjust version to match your target .NET version.

We keep the current version in our project template: havit/NewProjectTemplate-Blazor/global.json.

Robert Haken · HAVIT Software Architect, Founder at HAVIT, Microsoft MVP - ASP.NET/IIS.
Has 53 articles in the knowledge base.
All articles by this author →
HAVIT
Read next
Discussion

Leave a reply