{"record":{"id":"a750870b6039eb2b","repo":"oraios/serena","slug":"dotnet-not-found-on-the-system","errorCode":null,"errorMessage":"dotnet not found on the system","messagePattern":"dotnet not found on the system","errorType":"exception","errorClass":"SolidLSPException","httpStatus":null,"severity":"error","filePath":"src/solidlsp/ls_utils.py","lineNumber":764,"sourceCode":"        }\n\n        return arch_map.get(sys_info.wProcessorArchitecture, f\"Unknown ({sys_info.wProcessorArchitecture})\")\n\n    @staticmethod\n    def get_dotnet_version() -> DotnetVersion:\n        \"\"\"\n        Returns the dotnet version for the current system\n        \"\"\"\n        try:\n            result = subprocess_run([\"dotnet\", \"--list-runtimes\"], capture_output=True, check=True)\n            available_version_cmd_output = []\n            for line in result.stdout.split(\"\\n\"):\n                if line.startswith(\"Microsoft.NETCore.App\"):\n                    version_cmd_output = line.split(\" \")[1]\n                    available_version_cmd_output.append(version_cmd_output)\n\n            if not available_version_cmd_output:\n                raise SolidLSPException(\"dotnet not found on the system\")\n\n            # Check for supported versions in order of preference (latest first)\n            for version_cmd_output in available_version_cmd_output:\n                if version_cmd_output.startswith(\"9\"):\n                    return DotnetVersion.V9\n                if version_cmd_output.startswith(\"8\"):\n                    return DotnetVersion.V8\n                if version_cmd_output.startswith(\"7\"):\n                    return DotnetVersion.V7\n                if version_cmd_output.startswith(\"6\"):\n                    return DotnetVersion.V6\n                if version_cmd_output.startswith(\"4\"):\n                    return DotnetVersion.V4\n\n            # If no supported version found, raise exception with all available versions\n            raise SolidLSPException(\n                f\"No supported dotnet version found. Available versions: {', '.join(available_version_cmd_output)}. Supported versions: 4, 6, 7, 8, 9\"\n            )","sourceCodeStart":746,"sourceCodeEnd":782,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/ls_utils.py#L746-L782","documentation":"Raised by get_dotnet_version when the `dotnet --list-runtimes` command succeeds but lists no Microsoft.NETCore.App runtime, meaning the dotnet CLI exists but no .NET Core runtime is installed (or the output format is unexpected).","triggerScenarios":"Calling get_dotnet_version (via _setup_runtime_dependencies, e.g. for the C# language server) on a machine where only the dotnet SDK binary stub exists without runtimes, or dotnet prints an unrecognized format.","commonSituations":"Freshly installed dotnet without any runtime; container images with SDK but stripped runtimes; corrupted dotnet installation.","solutions":["Install a .NET runtime: `dotnet --list-runtimes` should show a Microsoft.NETCore.App entry","Reinstall the .NET SDK/runtime if output looks corrupted","Fall back to installing mono if .NET is not desired"],"exampleFix":"// before\n$ which dotnet  # exists but no runtimes\n// after\n$ apt install dotnet-runtime-8.0  # or download SDK from dot.net","handlingStrategy":"validation","validationCode":"import subprocess\nout = subprocess.run([\"dotnet\", \"--list-runtimes\"], capture_output=True, text=True)\nruntimes = [l for l in out.stdout.splitlines() if l.startswith(\"Microsoft.NETCore.App\")]\nif not runtimes:\n    raise EnvironmentError(\"dotnet present but no .NET runtime installed\")","typeGuard":"def has_dotnet_runtime() -> bool:\n    try:\n        out = subprocess.run([\"dotnet\",\"--list-runtimes\"], capture_output=True, text=True, check=True)\n    except (FileNotFoundError, subprocess.CalledProcessError):\n        return False\n    return any(l.startswith(\"Microsoft.NETCore.App\") for l in out.stdout.splitlines())","tryCatchPattern":"try:\n    version = get_dotnet_version()\nexcept SolidLSPException as e:\n    if \"dotnet not found\" in str(e):\n        install_dotnet_runtime()\n    raise","preventionTips":["Run `dotnet --list-runtimes` before enabling C# language-server setup","Install a runtime, not just the SDK-less dotnet stub","In containers, use official mcr.microsoft.com/dotnet images","Reinstall dotnet if --list-runtimes output looks garbled"],"tags":["dotnet","environment","runtime"],"backgroundTag":"dotnet-runtime-missing","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}