{"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/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/plugins/core/dotnet.rs#L73-L109","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["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`).","Check that DOTNET_ROOT/MISE_DOTNET_ROOT points at mise's install dir and no other `dotnet` binary is shadowing it on PATH.","Retry the install; if it fails again, remove the half-installed version (`mise uninstall dotnet@<version>`) and reinstall."],"exampleFix":"// before\nmise use dotnet@9.0   # may install 9.0.100 but validator needs exact match\n// after\nmise use dotnet@9.0.100  # pin the full SDK version shown in dotnet --list-sdks","handlingStrategy":"validation","validationCode":"// verify before install that the exact SDK version exists\nconst out = execSync('dotnet --list-sdks').toString();\nif (!out.split('\\n').some(l => l.startsWith('9.0.100'))) {\n  console.warn('requested SDK version not present in dotnet --list-sdks');\n}","typeGuard":null,"tryCatchPattern":"try {\n  execSync('mise install dotnet');\n} catch (e) {\n  if (/was not found in `dotnet --list-sdks`/.test(String(e.stderr))) {\n    // align DOTNET_ROOT / PATH, or pin the full version shown in the message\n  }\n}","preventionTips":["Pin full SDK versions (9.0.100) instead of channel versions (9.0) when verification matters.","Keep DOTNET_ROOT pointed at mise's install directory and avoid system dotnet shadowing.","After failures, uninstall the broken version before reinstalling."],"tags":["dotnet","install","verification"],"backgroundTag":"resource-not-found","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}