oraios/serena · error · SolidLSPException

dotnet or mono not found on the system

Error message

dotnet or mono not found on the system

What it means

Final fallback failure of get_dotnet_version: neither dotnet (not installed, or errored, or unsupported versions) nor mono (not installed or errored) could produce a usable .NET runtime. Thrown when setting up dependencies for language servers that require .NET (e.g. C#/OmniSharp).

Source

Thrown at src/solidlsp/ls_utils.py:788

                if version_cmd_output.startswith("8"):
                    return DotnetVersion.V8
                if version_cmd_output.startswith("7"):
                    return DotnetVersion.V7
                if version_cmd_output.startswith("6"):
                    return DotnetVersion.V6
                if version_cmd_output.startswith("4"):
                    return DotnetVersion.V4

            # If no supported version found, raise exception with all available versions
            raise SolidLSPException(
                f"No supported dotnet version found. Available versions: {', '.join(available_version_cmd_output)}. Supported versions: 4, 6, 7, 8, 9"
            )
        except (FileNotFoundError, subprocess.CalledProcessError):
            try:
                result = subprocess_run(["mono", "--version"], capture_output=True, check=True)
                return DotnetVersion.VMONO
            except (FileNotFoundError, subprocess.CalledProcessError):
                raise SolidLSPException("dotnet or mono not found on the system")


class SymbolUtils:
    @staticmethod
    def symbol_tree_contains_name(roots: list[UnifiedSymbolInformation], name: str) -> bool:
        """
        Check if any symbol in the tree has a name matching the given name.
        """
        for symbol in roots:
            if symbol["name"] == name:
                return True
            if SymbolUtils.symbol_tree_contains_name(symbol["children"], name):
                return True
        return False

View on GitHub (pinned to 7fcbca7e62)

Solutions

  1. Install the .NET SDK or runtime (https://dot.net) and ensure `dotnet` is on PATH for the process launching this library
  2. Alternatively install mono (`apt install mono-complete`) which the library accepts as a fallback
  3. If dotnet is installed, verify it is reachable in the same environment (PATH, shell profile) that runs your editor/CI

Example fix

// before
$ dotnet --version  # command not found
// after
$ curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 8.0
$ export PATH="$PATH:$HOME/.dotnet"
Defensive patterns

Strategy: validation

Validate before calling

import shutil
if not (shutil.which("dotnet") or shutil.which("mono")):
    raise EnvironmentError("Install .NET SDK (https://dot.net) or mono before C# language-server setup")

Type guard

def dotnet_or_mono_available() -> bool:
    return shutil.which("dotnet") is not None or shutil.which("mono") is not None

Try / catch

try:
    version = get_dotnet_version()
except SolidLSPException as e:
    if "dotnet or mono not found" in str(e):
        raise MissingDependencyError("install dotnet SDK/runtime or mono") from e
    raise

Prevention

When it happens

Trigger: get_dotnet_version called via _setup_runtime_dependencies on a machine with neither dotnet nor mono on PATH, or where both fail to execute.

Common situations: Fresh CI containers or developer machines without any .NET; mono removed after migration to dotnet; PATH not containing the dotnet install dir in IDE-spawned shells.

Related errors


AI-assisted analysis of oraios/serena@7fcbca7e62 (2026-08-29). Data as JSON: /api/errors/d20fbcc0bb1f7223. Report an issue: GitHub.