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.