Slnx.Combine
0.0.3
See the version list below for details.
dotnet tool install --global Slnx.Combine --version 0.0.3
dotnet new tool-manifest
dotnet tool install --local Slnx.Combine --version 0.0.3
#tool dotnet:?package=Slnx.Combine&version=0.0.3
nuke :add-package Slnx.Combine --version 0.0.3
slnx-combiner
slnx-combine is a .NET tool that searches a directory and its subdirectories for Visual Studio solution files (.sln and .slnx) and combines their projects into one XML solution (.slnx).
Install
dotnet tool install --global Slnx.Combine --version 0.0.2
Usage
slnx-combine <Output> [TraverseDirectory]
Outputis the generated solution path. If its extension is not.slnx, the tool changes it to.slnx.TraverseDirectoryis the directory searched recursively for.slnand.slnxfiles. When omitted, the output file's directory is searched.
When installed as a global .NET tool from NuGet:
slnx-combine combined.slnx C:\code\my-repository
When running the project directly:
dotnet run --project src/SlnxCombiner/SlnxCombiner.csproj -- combined.slnx C:\code\my-repository
The output file is excluded from the discovered input solutions, so an existing combined solution can be regenerated in place.
How the combined solution is generated
For every discovered solution, the tool:
- Reads all of its projects.
- Resolves project paths relative to that input solution.
- Rewrites the paths relative to the generated output file.
- Places the projects in a solution folder named after the input solution file.
If multiple input solutions have the same filename, their generated folder names receive suffixes such as _1 and _2. A project referenced by more than one solution is emitted only once, directly under the root of the combined solution. Project display names and project type metadata are preserved when present.
For example, combining Api.slnx and Worker.sln, which both reference Shared.csproj, produces a structure similar to:
<Solution>
<Project Path="src/Shared/Shared.csproj" />
<Folder Name="/Api/">
<Project Path="src/Api/Api.csproj" />
</Folder>
<Folder Name="/Worker/">
<Project Path="src/Worker/Worker.csproj" />
</Folder>
</Solution>
The exact relative paths depend on the locations of the input solutions, projects, and output file.
Build and test
dotnet test slnx-combiner.slnx
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.
Add --overwrite flag to ensure no unintentional overwrite of existing slnx file. Added version. Better output when combing