{"record":{"id":"edca07378d53721c","repo":"jdx/mise","slug":"dotnet-sdk-was-not-found-in-dotnet-list-sdks","errorCode":null,"errorMessage":"dotnet SDK {} was not found in `dotnet --list-sdks` output:\n{}","messagePattern":"dotnet SDK (.+?) was not found in `dotnet --list-sdks` output:\n(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/plugins/core/dotnet.rs","lineNumber":91,"sourceCode":"            return Ok(());\n        }\n        ctx.pr.set_message(\"dotnet --list-sdks\".into());\n        let sdks = CmdLineRunner::new(DOTNET_BIN)\n            .with_pr(ctx.pr.as_ref())\n            .arg(\"--list-sdks\")\n            .env_values(tv.install_env())\n            .envs(self.exec_env(&ctx.config, &ctx.ts, tv).await?)\n            .prepend_path(self.list_bin_paths(&ctx.config, tv).await?)?\n            .read()\n            .await?\n            .lines()\n            .map(str::to_string)\n            .collect::<Vec<_>>();\n\n        if sdk_list_contains_version(&sdks, &tv.version) {\n            Ok(())\n        } else {\n            eyre::bail!(\n                \"dotnet SDK {} was not found in `dotnet --list-sdks` output:\\n{}\",\n                tv.version,\n                sdk_list_display(&sdks)\n            )\n        }\n    }\n}\n\n#[async_trait]\nimpl Backend for DotnetPlugin {\n    fn ba(&self) -> &Arc<BackendArg> {\n        &self.ba\n    }\n\n    fn supports_lockfile_url(&self) -> bool {\n        false\n    }\n","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/plugins/core/dotnet.rs#L73-L109","documentation":"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.","triggerScenarios":"`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.","commonSituations":"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.","solutions":["Re-run `dotnet --list-sdks` manually and compare with the requested version","Clear the dotnet install cache and retry (`mise cache clear dotnet` or remove ~/.local/share/mise/installs/dotnet/<version>)","Check DOTNET_ROOT and DOTNET_MULTILEVEL_LOOKUP env vars are not pointing elsewhere","Retry the install to rule out a truncated download"],"exampleFix":"// before\nexport DOTNET_ROOT=/usr/lib/dotnet  # stale path\nmise install dotnet@8.0.100\n// after\nunset DOTNET_ROOT\nmise install dotnet@8.0.100","handlingStrategy":"validation","validationCode":"dotnet --list-sdks | grep -q \"^8.0.100\" || echo \"SDK missing\"","typeGuard":"null","tryCatchPattern":"catch (e) {\n  if (/was not found in `dotnet --list-sdks`/.test(String(e))) {\n    // clear cache, unset DOTNET_ROOT, reinstall\n  }\n}","preventionTips":["Keep DOTNET_ROOT/DOTNET_MULTILEVEL_LOOKUP unset or correct in mise-managed environments","Verify disk space before large SDK installs","Run `dotnet --list-sdks` after install in CI as a smoke test","Reinstall on verification failure instead of proceeding"],"tags":["dotnet","install","verification","core-plugin"],"backgroundTag":"unexpected-response-shape","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}