.NET SDK Version Not Found on the Runner in CI
CI runners ship a specific set of preinstalled SDKs that changes over time. When your build needs a version that is not in that set, commands fail or silently use the wrong SDK. Install the exact version explicitly instead of assuming the runner has it.
What this error means
The build errors that the requested SDK is not installed, or quietly uses a different SDK than intended (subtle behavior differences). Tied to the runner image's preinstalled SDK set.
dotnet
The specified SDK version '9.0.100' could not be found. Installed SDKs:
8.0.404 [/usr/share/dotnet/sdk]Common causes
The runner image does not include the version
The preinstalled SDK set on the runner does not contain the requested version, so it is unavailable.
Reliance on whatever is preinstalled
The workflow never pins a version, so it drifts as the runner image updates.
How to fix it
Install the exact SDK with setup-dotnet
- Add an explicit
actions/setup-dotnetstep with the precise version. - List multiple versions if you build several TFMs.
- Re-run.
workflow setup
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
9.0.xPin via global.json for reproducibility
- Commit a
global.jsonpinning the SDK and install it withglobal-json-file. - This keeps local and CI on the same SDK.
- Re-run.
How to prevent it
- Always install the SDK explicitly; never rely on the runner default.
- Pin the SDK with
global.jsonand install from it. - On self-managed runners, prebake the SDKs your builds need.
Related guides
A compatible .NET SDK was not found (global.json) in CIFix "A compatible installed .NET SDK was not found" in CI - global.json pins an SDK version that is not insta…
"dotnet: command not found" in CIFix "dotnet: command not found" in CI - the .NET SDK is not installed or not on PATH on the runner, so the sh…
"The current .NET SDK does not support targeting .NET X" in CIFix "The current .NET SDK does not support targeting .NET X" in CI - the installed SDK is older than the fram…