Skip to content

Phase 5: Solution file integration (.sln and .slnx) #7

Description

@markdav-is

Summary

Implement ISolutionService to detect solution file format and add newly created module projects to the solution.

Depends On

  • Phase 4: File Generation (needs projects to exist on disk)

Tasks

  • Implement ISolutionService / SolutionService:
    • FindSolutionFile(string directory) → string (path to .slnx or .sln)
    • DetectFormat(string solutionPath)SolutionFormat enum (Slnx | Sln)
    • AddProjects(string solutionPath, List<string> projectPaths) → void
  • .slnx support (JSON-based, .NET 10+):
    • Parse existing .slnx JSON
    • Append new project entries to the projects array
    • Write back with proper formatting
  • .sln support (classic text format):
    • Parse existing .sln to find insertion point
    • Add Project("...") entries with new GUIDs
    • Add to solution configuration platforms
  • Verify solution file is valid after modification:
    • dotnet sln list should show new projects
    • dotnet build should not fail due to solution file issues

Acceptance Criteria

  • New projects are added to .slnx files correctly
  • New projects are added to .sln files correctly
  • dotnet sln list shows the new projects after modification
  • Solution file format is auto-detected
  • Existing projects in the solution are not disturbed

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions