GitHub Actions actions/setup-dotnet "Could not find SDK"
actions/setup-dotnet drives dotnet-install to fetch SDKs from the .NET release feeds. A version or channel with no matching SDK for the runner platform fails the install.
What this error means
A setup-dotnet step fails resolving the SDK, often after requesting a version that has no published build or a channel that does not exist.
Error: Could not find any version matching 9.0.999 in channel.
dotnet-install: Could not find SDK with the specified version.Common causes
SDK version not published
A non-existent patch or a prerelease band that is not yet released has no entry in the .NET feed.
global.json pins a missing SDK
A global.json sdk.version that the runner cannot satisfy makes setup-dotnet (or the build) fail to find a usable SDK.
How to fix it
Use a valid channel or version
- Set dotnet-version to a major.minor (e.g. 8.0.x) so setup-dotnet selects the newest published patch.
- If you use global.json, align rollForward or the pinned version with an available SDK.
- Confirm the version exists in the .NET release feed.
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'How to prevent it
- Prefer a major.minor band (8.0.x) over an exact patch.
- Set rollForward in global.json to tolerate patch differences.
- Latchkey managed runners auto-retry the SDK download on transient feed failures.