Microsoft Visual Studio SOLution Validation console tool and parsing library written in Rust.
The repository contains two crates:
solv— the command-line tool that validates and analyzes Visual Studio solution (.sln) files.solp— the underlying parsing library thatsolvis built on. It can be used independently to parse.slnfiles from your own Rust code.
- Validate Visual Studio solutions and detect common problems: dependency cycles, dangling configurations, duplicate project GUIDs, duplicate configuration mappings, missing project files, configuration mappings outside the solution list, orphan projects (not built in any configuration), and redundant project references.
- Show detailed information about solutions and their projects.
- Inspect NuGet packages referenced by a solution and find version mismatches.
- Convert a solution to JSON for further processing.
- Scan a single
.slnfile, read from standard input, or recursively scan a directory. - Generate shell auto-completion scripts.
homebrew (only on macOS and Linux for now):
Add my tap (do it once):
brew tap aegoroff/tapAnd then install solv:
brew install solvUpdate solv if already installed:
brew upgrade solvscoop:
scoop bucket add aegoroff https://github.com/aegoroff/scoop-bucket.git
scoop install solvAUR (Arch Linux User Repository):
install binary package:
yay -S solv-binor if yay reports that package not found force updating repo info
yay -Syyu solv-bininstall using cargo so building on target machine:
yay -S solvor if yay reports that package not found force updating repo info
yay -Syyu solvmanually:
Download the pre-compiled binaries from the releases and copy to the desired location. RPM and DEB packages are available to install under RedHat or Debian based Linux distros.
install deb package on Arch Linux:
- Install debtap from AUR using yay:
yay -S debtap- Create equivalent package using debtap:
sudo debtap -u
debtap solv_x.x.x_amd64.deb- Install using pacman:
sudo pacman -U solv-x.x.x-1-x86_64.pkg.tar.zstWith a recent Rust toolchain installed you can build and install solv from
crates.io:
cargo install solvsolv is a subcommand-based CLI. Run solv --help to see a list of subcommands,
or solv <subcommand> --help for details on a specific one.
solv <SUBCOMMAND> [OPTIONS] [PATH]
Available subcommands:
| Subcommand | Alias | Description |
|---|---|---|
validate |
va |
Validates solutions within a directory or a single file |
validate fix |
Fix redundant project references in project files | |
info |
i |
Show information about found solutions (projects, configurations, versions, ...) |
nuget |
nu |
Show NuGet packages used in solutions and detect version mismatches |
json |
j |
Convert solution(s) into JSON |
completion |
Generate the autocompletion script for the specified shell | |
bugreport |
Collect information about the system and environment for bug reports |
Common options accepted by validate, validate fix, info, nuget and json:
| Option | Description |
|---|---|
-e, --ext <EXTENSION> |
Visual Studio solution extension (default: sln) |
-r, --recursively |
Scan the directory recursively (default: false) |
--showerrors |
Output solution parsing errors while scanning directories (default: false) |
-t, --time |
Show scanning time when scanning a directory (default: false) |
Subcommand-specific options:
| Subcommand | Option | Description |
|---|---|---|
validate |
-p, --problems |
Show only solutions with problems |
nuget |
-m, --mismatch |
Show only packages with version mismatches |
nuget |
-f, --fail |
Exit with a non-zero code if mismatches are found |
json |
-p, --pretty |
Pretty-print JSON output |
The PATH argument can be either a path to a single .sln file or to a
directory. For the info and json subcommands, if PATH is omitted the
solution is read from standard input. validate, validate fix, and nuget
require PATH.
Validate a single solution file:
solv validate path/to/MySolution.slnRecursively validate all solutions in a directory, showing only the ones with problems:
solv validate -r -p path/to/sourcesShow information about a solution:
solv info path/to/MySolution.slnFind NuGet package version mismatches and fail (non-zero exit code) if any are found:
solv nuget -r -m -f path/to/sourcesFix redundant project references recursively in a directory:
solv validate fix -r path/to/sourcesConvert a solution to pretty-printed JSON:
solv json -p path/to/MySolution.slnRead a solution from standard input and convert it to JSON:
cat path/to/MySolution.sln | solv jsonGenerate a shell completion script (example for bash):
solv completion bash > /etc/bash_completion.d/solv