oraios/serena · error · SolidLSPException
Failed to install .NET {version} runtime: {e}
Error message
Failed to install .NET {version} runtime: {e} What it means
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.
Source
Thrown at src/serena/util/dotnet.py:157
# Run the install script
log.info("Running .NET install script: %s", cmd)
result = subprocess_run(cmd, capture_output=True, text=True, check=True)
log.debug(f"Install script output: {result.stdout}")
if not dotnet_exe.exists():
raise SolidLSPException(f"dotnet executable not found at {dotnet_exe} after installation")
log.info(f"Successfully installed .NET {version} runtime to {dotnet_exe}")
return str(dotnet_exe)
except subprocess.CalledProcessError as e:
raise SolidLSPException(f"Failed to install .NET {version} runtime using install script: {e.stderr if e.stderr else e}") from e
except Exception as e:
message = f"Failed to install .NET {version} runtime: {e}"
if is_windows and isinstance(e, FileNotFoundError):
message += "; pwsh, i.e. PowerShell 7+, is required to install .NET runtime. Make sure pwsh is available on your system."
raise SolidLSPException(message) from e
View on GitHub (pinned to 7fcbca7e62)
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
Example fix
// before > pwsh -v # not recognized // after winget install --id Microsoft.PowerShell --source winget pwsh --version # 7.x
Defensive patterns
Strategy: fallback
Validate before calling
import shutil
if shutil.which("pwsh") is None:
raise RuntimeError("pwsh (PowerShell 7+) is required to run the .NET install script on Windows") Try / catch
try:
path = util.install_dotnet_with_script(version)
except SolidLSPException as e:
if "pwsh" in str(e):
print("Install PowerShell 7+: winget install Microsoft.PowerShell")
raise Prevention
- 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
When it happens
Trigger: Unexpected errors during install — e.g. FileNotFoundError because pwsh is missing on Windows, permission errors writing to the install dir, OSError during extraction.
Common situations: Windows machines with only Windows PowerShell 5.1 (powershell.exe) but no pwsh; read-only install directories; antivirus blocking downloaded binaries.
Related errors
- dotnet executable not found at {dotnet_exe} after installati
- Required .NET runtime version {self._required_version_str} n
- Failed to install .NET {version} runtime using install scrip
- dotnet not found on the system
- No supported dotnet version found. Available versions: {', '
AI-assisted analysis of oraios/serena@7fcbca7e62 (2026-08-29).
Data as JSON: /api/errors/47cdccade8a63758.
Report an issue: GitHub.