2.1 KiB
2.1 KiB
Solution Cleanup Tool
A C# console application that systematically identifies and removes missing project references from Visual Studio solution files.
Project Structure
Core Components
-
Models/: Data models representing solution structure and analysis results
SolutionModel.cs- Represents a parsed Visual Studio solutionProjectReference.cs- Represents a project reference within a solutionMissingProject.cs- Represents a missing project referenceCleanupResult.cs- Represents the result of cleanup operationsAnalysisResult.cs- Represents analysis results for project referencesValidationResult.cs- Represents validation results after cleanupDependencyGraph.cs- Represents project dependency relationships
-
Interfaces/: Core service interfaces
ISolutionParser.cs- Interface for parsing solution filesIProjectReferenceAnalyzer.cs- Interface for analyzing project referencesICleanupEngine.cs- Interface for performing cleanup operationsIValidationEngine.cs- Interface for validating cleaned solutions
Dependencies
- FsCheck - Property-based testing framework
- Microsoft.Extensions.DependencyInjection - Dependency injection
- Microsoft.Extensions.Logging - Logging framework
- Xunit - Unit testing framework
Usage
SolutionCleanupTool <path-to-solution-file>
Example:
SolutionCleanupTool C:\MyProject\MySolution.sln
Development
The project follows a pipeline architecture with three main stages:
- Analysis Stage: Scans solution files to identify missing project references
- Cleanup Stage: Safely removes invalid references while preserving valid ones
- Validation Stage: Verifies solution integrity after cleanup
Testing
The project uses both unit tests and property-based tests:
- Unit Tests: Verify specific examples and edge cases
- Property Tests: Verify universal properties across all inputs using FsCheck
- Integration Tests: Test end-to-end workflows with real file system operations
Run tests with:
dotnet test