Skip to content
Latchkey

dotnet "global.json" SDK Version Not Found in CI

A global.json pins an exact SDK version, and that version is not installed on the runner. The .NET host refuses to fall back unless rollForward allows it.

What this error means

Any dotnet command in the repo fails immediately, before building, complaining the SDK version from global.json was not found and listing the SDKs that are installed.

Terminal
A compatible .NET SDK was not found.

Requested SDK version: 8.0.401
global.json file: /home/runner/work/app/global.json

Installed SDKs:
8.0.205 [/usr/share/dotnet/sdk]

Common causes

The pinned SDK is not on the runner

The runner image ships a different SDK patch than global.json requires. With a strict rollForward, the host will not use a near-match.

rollForward is too strict

A rollForward of disable or patch prevents using a higher installed feature band, so a missing exact version is fatal.

How to fix it

Install the exact SDK in CI

Use actions/setup-dotnet to install the version global.json pins.

.github/workflows/ci.yml
- uses: actions/setup-dotnet@v4
  with:
    global-json-file: global.json   # installs exactly what's pinned

Relax the rollForward policy

Allow rolling forward to a newer patch or feature band so a close install satisfies the pin.

global.json
{
  "sdk": {
    "version": "8.0.401",
    "rollForward": "latestFeature"
  }
}

Confirm what is installed

  1. Run dotnet --list-sdks in CI to see available versions.
  2. Compare against the version in global.json.
  3. Either install the missing SDK or adjust the pin/rollForward to match.

How to prevent it

  • Install the SDK from global.json with setup-dotnet so CI always matches the pin.
  • Use a rollForward policy that tolerates patch differences across runner images.
  • Keep global.json versions current with the runners you target.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →