jdx/mise · error

dotnet SDK {} was not found in `dotnet --list-sdks` output:

Error message

dotnet SDK {} was not found in `dotnet --list-sdks` output:
{}

What it means

After installing a dotnet SDK version, mise verifies the install by running `dotnet --list-sdks` and checking the requested version appears in the output. In test_dotnet (called by install_version_), if the version string is absent from that listing, mise bails because the install cannot be confirmed.

Source

Thrown at src/plugins/core/dotnet.rs:91

            return Ok(());
        }
        ctx.pr.set_message("dotnet --list-sdks".into());
        let sdks = CmdLineRunner::new(DOTNET_BIN)
            .with_pr(ctx.pr.as_ref())
            .arg("--list-sdks")
            .env_values(tv.install_env())
            .envs(self.exec_env(&ctx.config, &ctx.ts, tv).await?)
            .prepend_path(self.list_bin_paths(&ctx.config, tv).await?)?
            .read()
            .await?
            .lines()
            .map(str::to_string)
            .collect::<Vec<_>>();

        if sdk_list_contains_version(&sdks, &tv.version) {
            Ok(())
        } else {
            eyre::bail!(
                "dotnet SDK {} was not found in `dotnet --list-sdks` output:\n{}",
                tv.version,
                sdk_list_display(&sdks)
            )
        }
    }
}

#[async_trait]
impl Backend for DotnetPlugin {
    fn ba(&self) -> &Arc<BackendArg> {
        &self.ba
    }

    fn supports_lockfile_url(&self) -> bool {
        false
    }

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Inspect the `dotnet --list-sdks` output included in the message and compare against the version you requested; install the exact version that exists (`mise use dotnet@9.0.101`).
  2. Check that DOTNET_ROOT/MISE_DOTNET_ROOT points at mise's install dir and no other `dotnet` binary is shadowing it on PATH.
  3. Retry the install; if it fails again, remove the half-installed version (`mise uninstall dotnet@<version>`) and reinstall.

Example fix

// before
mise use dotnet@9.0   # may install 9.0.100 but validator needs exact match
// after
mise use dotnet@9.0.100  # pin the full SDK version shown in dotnet --list-sdks
Defensive patterns

Strategy: validation

Validate before calling

// verify before install that the exact SDK version exists
const out = execSync('dotnet --list-sdks').toString();
if (!out.split('\n').some(l => l.startsWith('9.0.100'))) {
  console.warn('requested SDK version not present in dotnet --list-sdks');
}

Try / catch

try {
  execSync('mise install dotnet');
} catch (e) {
  if (/was not found in `dotnet --list-sdks`/.test(String(e.stderr))) {
    // align DOTNET_ROOT / PATH, or pin the full version shown in the message
  }
}

Prevention

When it happens

Trigger: dotnet installation completed but the version listed by --list-sdks doesn't match the requested ToolVersion — e.g. requesting '9.0' but dotnet registers '9.0.100', a channel/feature-band mismatch, or the install directory was set up under a different DOTNET_ROOT than the dotnet on PATH.

Common situations: Mismatched DOTNET_ROOT or PATH shadowing by a system dotnet; requesting a channel-style version (9.0) resolved to a patch the validator compares literally; partially failed installs where the sdk folder is missing.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/edca07378d53721c. Report an issue: GitHub.