-
Notifications
You must be signed in to change notification settings - Fork 0
Add slnx command to create organized Visual Studio solution files with multiple root directory support and Git-based obsolete project detection #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ation Co-authored-by: dlosch <[email protected]>
@copilot I am so disappointed with you. The project file could not be loaded. Microsoft.VisualStudio.SolutionPersistence.Model.SolutionException: Solution folder path 'Console' must start and end with '/'. (Parameter 'path') Build failed with 1 error(s) in 0.0s |
Co-authored-by: dlosch <[email protected]>
Fixed the folder path format issue. The .slnx format requires folder paths to start and end with '/' characters. Updated the XML generation to use "/Console/" instead of "Console" for folder names. This resolves the Visual Studio SolutionPersistence.Model error you encountered. Commit 9b7bcd4. |
@copilot it should be possible to specify multiple root folders and the command should traverse all the folders below all of these root folders for project files and add all of these projects to the new slnx. |
Co-authored-by: dlosch <[email protected]>
Added support for multiple root directories. The slnx command now accepts multiple directory arguments and will scan all specified directories for projects, combining them into a single organized solution file. Usage examples:
The command validates all directories exist, removes duplicates if paths overlap, and generates correct relative paths from the current working directory. Commit 3114700. |
@copilot additional group projects by git commit status. If the project is inside a git repo, for the folder where the project file resides and all nested folders, check when the last commit was made to the repo. If it is longer than a configurable duration with a default of 6 months, move the folder to a Obsolete group in the slnx and move the projects in buckets aka subfolders grouped by how old the last commit is |
…ping Co-authored-by: dlosch <[email protected]>
Added Git commit status-based project categorization. Projects in Git repositories are analyzed for their last commit date. Projects older than the configurable threshold (default 6 months) are moved to an "Obsolete" group with time-based sub-folders:
Usage:
The command detects Git repositories, checks last commit dates for project directories, and organizes obsolete projects separately from active ones. Commit 3bfb4c5. |
This PR implements a new
slnx
command that creates or updates Visual Studio solution files (.slnx) with automatic project discovery and intelligent type-based organization. The command supports scanning multiple root directories to create unified solution files across complex repository structures and automatically identifies obsolete projects based on Git commit history.Features
The
slnx
command automatically:Project Type Detection
The command intelligently categorizes projects based on their SDK, OutputType, and other properties:
Microsoft.NET.Sdk.Web
)OutputType: Exe
)IsPackable: true
)IsTestProject: true
)UseWPF: true
)UseWindowsForms: true
)Microsoft.NET.Sdk.Worker
)Git-Based Obsolete Project Detection
Projects in Git repositories are analyzed for their last commit activity. Projects older than the configurable threshold are automatically moved to an "Obsolete" group with time-based sub-folders:
Usage Examples
Multiple Root Directory Support
The command now accepts multiple root directory arguments, allowing you to:
Robust Implementation
The command includes:
Generated Output
This addresses the need for automated solution file management in .NET projects, especially useful for repositories with many projects across multiple directories that need logical organization. The Git-based obsolete detection helps maintain clean solution files by automatically identifying and segregating projects that haven't been actively maintained.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.