Getting started
Install dv
Section titled “Install dv”curl -fsSL https://raw.githubusercontent.com/adrum/dv/main/install.sh | shOn Windows, in PowerShell:
powershell -ExecutionPolicy Bypass -c "irm https://raw.githubusercontent.com/adrum/dv/main/install.ps1 | iex"Either script downloads the build for your platform, verifies it against the
published sha256, and puts dv in ~/.local/bin (override with DV_BIN_DIR).
Neither touches your shell profile or PATH — that line is yours to paste,
below.
From source instead:
cargo build --releaseinstall -m 0755 target/release/dv /usr/local/bin/dvGet an SDK
Section titled “Get an SDK”dv install lts # newest long-term-support SDKdv install 10.0 # newest 10.0.xdv install 10.0.4xx # newest in the 10.0.400 feature banddv install 10.0.402 # exactly this onedv install # whatever global.json here asks forPreviews install the same way — dv install 11 installs the newest 11
preview while 11 has not shipped. Once a release exists, lines prefer it.
Put the shims on PATH
Section titled “Put the shims on PATH”eval "$(dv init zsh)" # or bash, sh, fishAdd that to your shell profile. It does two things:
- prepends dv’s shim directory to
PATH, which matters: a shim directory placed after/usr/local/share/dotnetor a package manager’s prefix is silently shadowed by whateverdotnetis already there; - sets
DOTNET_ROOTto dv’s combined install root, so global tools and apps built with an app host find a runtime dv installed.
Then open a new shell — or run hash -r, because shells cache command
locations and yours may still remember a dotnet from before dv existed.
On Windows, add this to your PowerShell $PROFILE instead:
dv init powershell | Out-String | Invoke-Expressioncmd, editors and anything started outside PowerShell read the user PATH,
so put %LOCALAPPDATA%\dv\shims at the front of that as well, and set
DOTNET_ROOT to %LOCALAPPDATA%\dv\dotnet, then open a new terminal.
dv doctorDoctor confirms it worked and says plainly what to fix when it did not.
Pin an SDK for a project
Section titled “Pin an SDK for a project”cd ~/code/legacy-appdv pin 8.0dotnet --version # 8.0.x, here and belowdv pin writes global.json — the file dotnet, Visual Studio, Rider and CI
images already read — and keeps anything else in it. Commit it, and everyone
on the project gets the same SDK. How a version is chosen
explains what 8.0 turns into.
Run something under the resolved SDK
Section titled “Run something under the resolved SDK”dv run dotnet-ef migrations add Initdv run finds the command in the resolved SDK, then among global tools, then
on PATH, and points it at the resolved SDK’s install root. dotnet and
dnx need nothing special: their shims already do this.
Where dv keeps things
Section titled “Where dv keeps things”Everything lives in one directory — $XDG_DATA_HOME/dv, else
~/.local/share/dv, or %LOCALAPPDATA%\dv on Windows; set DV_HOME to put
it elsewhere. Removing dv is deleting that directory and the binary.