StockSharp/StockSharp · error · ValueError
solution not found: {solution}
Error message
solution not found: {solution} What it means
read_solution_connector_projects validates that the solution file (default StockSharp.slnx) exists before parsing it. If the file path does not resolve to an actual file, it raises ValueError. The .slnx format is an XML-based solution format used by newer .NET tooling.
Source
Thrown at scripts/check-solution-connectors.py:37
if not connectors_root.is_dir():
raise ValueError(f"connector repository not found: {connectors_root}")
projects: list[str] = []
solution_root = f"../{connectors_root.name}"
for directory in connectors_root.iterdir():
if not directory.is_dir() or directory.name == "Tests":
continue
for project in directory.glob("*.csproj"):
projects.append(f"{solution_root}/{directory.name}/{project.name}")
return sorted(projects, key=str.casefold)
def read_solution_connector_projects(solution: Path, connectors_root: Path) -> list[str]:
if not solution.is_file():
raise ValueError(f"solution not found: {solution}")
try:
root = ET.parse(solution).getroot()
except ET.ParseError as error:
raise ValueError(f"invalid solution XML: {solution}: {error}") from error
prefix = f"../{connectors_root.name}/"
projects: list[str] = []
for element in root.iter("Project"):
path = normalize_solution_path(element.get("Path", ""))
if path.startswith(prefix):
projects.append(path)
return projects
def main() -> int:View on GitHub (pinned to 601a191de6)
Solutions
- Verify the solution file exists: run from the repository root where StockSharp.slnx lives.
- Use --solution to pass the correct absolute or relative path.
- If the file was renamed, update the script's default or pass the new name via --solution.
Example fix
# before python scripts/check-solution-connectors.py --solution wrong-name.slnx # ERROR: solution not found: wrong-name.slnx # after python scripts/check-solution-connectors.py --solution StockSharp.slnx
Defensive patterns
Strategy: validation
Validate before calling
solution_path = Path("StockSharp.slnx").resolve()
if not solution_path.is_file():
print(f"Solution file not found: {solution_path}")
sys.exit(1) Prevention
- Run the script from the repository root where StockSharp.slnx resides.
- Verify the .slnx filename hasn't changed after solution-format migrations.
- Use absolute paths with --solution in CI for reliability.
When it happens
Trigger: Running check-solution-connectors.py with a --solution path that does not exist, or when the default StockSharp.slnx has been renamed, moved, or deleted.
Common situations: Running from a subdirectory where the relative path doesn't resolve; using --solution with a typo; the .slnx file was renamed in a solution-format refactor but the script default was not updated.
Related errors
- connector repository not found: {connectors_root}
- invalid solution XML: {solution}: {error}
- section not found: {title}
- No any directory or file was set for import.
AI-assisted analysis of StockSharp/StockSharp@601a191de6 (2026-08-13).
Data as JSON: /api/errors/8e13026ed5c78138.
Report an issue: GitHub.