solv
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.
Features
- Validate Visual Studio solutions and detect common problems (missing projects, duplicates, invalid configurations, dangling project references, etc.).
- 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.
Install the pre-compiled binary
homebrew (only on macOS and Linux for now):
Add my tap (do it once):
And then install solv:
Update solv if already installed:
scoop:
AUR (Arch Linux User Repository):
install binary package:
or if yay reports that package not found force updating repo info
install using cargo so builiding on target machine:
or if yay reports that package not found force updating repo info
manually:
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:
- Create equivalent package using debtap:
- Install using pacman:
Install from source
With a recent Rust toolchain installed you can build and install solv from
crates.io:
Usage
solv 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 |
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, 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) |
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.
Examples
Validate a single solution file:
Recursively validate all solutions in a directory, showing only the ones with problems:
Show information about a solution:
Find NuGet package version mismatches and fail (non-zero exit code) if any are found:
Convert a solution to pretty-printed JSON:
Read a solution from standard input and convert it to JSON:
|
Generate a shell completion script (example for bash):