{"record":{"id":"47cdccade8a63758","repo":"oraios/serena","slug":"failed-to-install-net-version-runtime-e","errorCode":null,"errorMessage":"Failed to install .NET {version} runtime: {e}","messagePattern":"Failed to install \\.NET (.+?) runtime: (.+?)","errorType":"exception","errorClass":"SolidLSPException","httpStatus":null,"severity":"error","filePath":"src/serena/util/dotnet.py","lineNumber":157,"sourceCode":"\n            # Run the install script\n            log.info(\"Running .NET install script: %s\", cmd)\n            result = subprocess_run(cmd, capture_output=True, text=True, check=True)\n            log.debug(f\"Install script output: {result.stdout}\")\n\n            if not dotnet_exe.exists():\n                raise SolidLSPException(f\"dotnet executable not found at {dotnet_exe} after installation\")\n\n            log.info(f\"Successfully installed .NET {version} runtime to {dotnet_exe}\")\n            return str(dotnet_exe)\n\n        except subprocess.CalledProcessError as e:\n            raise SolidLSPException(f\"Failed to install .NET {version} runtime using install script: {e.stderr if e.stderr else e}\") from e\n        except Exception as e:\n            message = f\"Failed to install .NET {version} runtime: {e}\"\n            if is_windows and isinstance(e, FileNotFoundError):\n                message += \"; pwsh, i.e. PowerShell 7+, is required to install .NET runtime. Make sure pwsh is available on your system.\"\n            raise SolidLSPException(message) from e\n","sourceCodeStart":139,"sourceCodeEnd":158,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/serena/util/dotnet.py#L139-L158","documentation":"Catch-all branch of install_dotnet_with_script: any non-CalledProcessError exception during installation is wrapped as 'Failed to install .NET {version} runtime: {e}'. On Windows, FileNotFoundError is augmented to note that pwsh (PowerShell 7+) is required.","triggerScenarios":"Unexpected errors during install — e.g. FileNotFoundError because pwsh is missing on Windows, permission errors writing to the install dir, OSError during extraction.","commonSituations":"Windows machines with only Windows PowerShell 5.1 (powershell.exe) but no pwsh; read-only install directories; antivirus blocking downloaded binaries.","solutions":["On Windows: install PowerShell 7+ (pwsh) and ensure it is on PATH (winget install Microsoft.PowerShell)","Inspect the wrapped exception message for the underlying cause","Ensure the install directory is writable and not blocked by antivirus","Install the .NET runtime manually via the official installer instead of the script"],"exampleFix":"// before\n> pwsh -v  # not recognized\n// after\nwinget install --id Microsoft.PowerShell --source winget\npwsh --version  # 7.x","handlingStrategy":"fallback","validationCode":"import shutil\nif shutil.which(\"pwsh\") is None:\n    raise RuntimeError(\"pwsh (PowerShell 7+) is required to run the .NET install script on Windows\")","typeGuard":null,"tryCatchPattern":"try:\n    path = util.install_dotnet_with_script(version)\nexcept SolidLSPException as e:\n    if \"pwsh\" in str(e):\n        print(\"Install PowerShell 7+: winget install Microsoft.PowerShell\")\n    raise","preventionTips":["On Windows ensure pwsh is installed before running script-based installs","Ensure the install directory is writable and not blocked by antivirus","Fallback to the official GUI installer when script installs fail"],"tags":["dotnet","installation","windows","pwsh","environment"],"backgroundTag":"missing-runtime-dependency","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}