Read & edit .sln solution files with various tools: .Subsln files, Visual Studio plugin, command line tool & .NET libraries.
SubSolution is a tool set giving you control on your Visual Studio solutions.
It includes various tools:
.subsln
SubSolution use XML files with the extension .subsln
to describe the content of Visual Studio solutions in a user-friendly syntax.
You can find the .subsln format documentation at this address: https://subsln.github.io.
That address is also the XML namespace used by .subsln files so you will always be a click away from the doc!
<Subsln xmlns="http://subsln.github.io">
<Root>
<Folder Name="Tools">
<Files Path="tools/*.bat" />
</Folder>
<Folder Name="Tests">
<Projects Path="**/*.Tests.csproj" />
</Folder>
<Projects Path="src/">
</Root>
</Subsln>
<Root>
<Projects>
<Files>
<Folder>
<Dependencies>
/ <Dependents>
<Solutions>
/ <SubSolutions>
<KeepOnly>
<Where>
<Configurations>
/ <Platforms>
<SolutionConfiguration>
/ <SolutionPlatform>
<ProjectConfiguration>
/ <ProjectPlatform>
The complete documentation is available on https://subsln.github.io.
.subsln
file ?The Visual Studio extension includes the following features:
You can create/open the .subsln file associated to the current solution from the Solution Explorer context menu.
When saving a .subsln file, you can see a preview of the updated solution and decide if you want to apply it or not.
When opening a solution, it automatically checks if your solution is up-to-date.
subsln
"subsln
" is a command line tool using .subsln
configuration files to build Visual Studio solutions.
> subsln create MySolution
> subsln generate MySolution.subsln
> subsln validate MySolution.subsln
> subsln show MySolution.sln
Install it with the .NET SDK command line:
> dotnet tool install subsln --global
Check the Releases page for standalone executables.
By default, subsln
will try to find MSBuild binaries on your machine. There are multiple options to specify which MSBuild binaries use to read projects. Use subsln help
or subsln [command] --help
for more details on commands.
You can use SubSolution .NET libraries as Nuget packages:
The API is structured around 3 representations of solutions:
Solution
:
ManualSolution
to manually fill configuration-platforms.RawSolution
:
Solution
with RawSolutionConverter
/SolutionConverter
.Subsln
:
Solution
with SolutionBuilder
.SubSolution is currently released as version v0. All core features are already implemented but it needs to be tested in more practical cases.
Also be aware of the following:
- Some small API breaking changes might happen until version v1.
- Some MSBuild project types are not supported yet. (Supported project types)
SubSolution.MsBuild
implements MsBuildProjectReader
to read projects with MSBuild. But core MSBuild DLLs are not enough to read every project types because some dependencies are installed by Visual Studio modular setup. The MSBuild setup coming with .NET SDK also mostly support .NET projects only.
For that reason, SubSolution.MsBuild
package does not come with MSBuild DLLs to let you choose between multiple strategies if you need a project reader:
MsBuildProjectReader.ImportFallback
to true to read project even on missing import/SDKs.IProjectReader
if you don't want to depends on MSBuild.