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, mise verifies it by running `dotnet --list-sdks`. This bail fires when the freshly installed version does not appear in that output, meaning the installation did not actually land as expected.

Solutions

  1. Re-run `dotnet --list-sdks` manually and compare with the requested version
  2. Clear the dotnet install cache and retry (`mise cache clear dotnet` or remove ~/.local/share/mise/installs/dotnet/<version>)
  3. Check DOTNET_ROOT and DOTNET_MULTILEVEL_LOOKUP env vars are not pointing elsewhere
  4. Retry the install to rule out a truncated download

Example fix

// before
export DOTNET_ROOT=/usr/lib/dotnet  # stale path
mise install dotnet@8.0.100
// after
unset DOTNET_ROOT
mise install dotnet@8.0.100
Defensive patterns

Strategy: validation

Validate before calling

dotnet --list-sdks | grep -q "^8.0.100" || echo "SDK missing"

Type guard

null

Try / catch

catch (e) {
  if (/was not found in `dotnet --list-sdks`/.test(String(e))) {
    // clear cache, unset DOTNET_ROOT, reinstall
  }
}

Prevention

When it happens

Trigger: `mise install dotnet@<version>` where the post-install verification via `dotnet --list-sdks` does not list the requested version, e.g. partial download, wrong install directory, or a dotnet shim resolving to a different SDK root.

Common situations: Corrupt or truncated SDK downloads; DOTNET_ROOT / PATH conflicts pointing dotnet at another installation; disk-full installs; older dotnet output formats or the SDK installing but the runtime shim not registered.

Related errors


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

Appendix: 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 533346cc37)