Installation
Contents
Requirements
- A .NET SDK, version 8.0 or later. The tool runs on .NET 8 and .NET 10.
- Test projects that run with
dotnet test(xUnit, NUnit or MSTest on VSTest).
The SDK runs the tool; your test projects can target other frameworks, as long as that SDK can build and run them.
Global tool
Recommended for local use. The command is available in every folder:
dotnet tool install --global dotnet-test-rerun
test-rerun --help
Update or remove it:
dotnet tool update --global dotnet-test-rerun
dotnet tool uninstall --global dotnet-test-rerun
Local tool
Recommended for CI and teams. The version is pinned in .config/dotnet-tools.json, which you commit:
dotnet new tool-manifest # once per repository, if there is no manifest yet
dotnet tool install dotnet-test-rerun
Run it with dotnet in front:
dotnet tool restore # on a fresh clone or in CI
dotnet test-rerun --help
A specific or pre-release version
dotnet tool install --global dotnet-test-rerun --version 4.2.0
# Pre-releases and preview builds of pull requests
dotnet tool install --global dotnet-test-rerun --version 5.0.0-alpha.0
The versions are listed on NuGet.
Docker
docker pull joaoopereira/dotnet-test-rerun:latest
See the Docker guide.
Check the installed version
dotnet tool list --global dotnet-test-rerun # global tool
dotnet tool list dotnet-test-rerun # local tool
test-rerun: command not found
Global tools are installed in a folder that must be on your PATH:
- Windows:
%USERPROFILE%\.dotnet\tools - Linux and macOS:
$HOME/.dotnet/tools
Open a new terminal after the first install. In containers and CI images, add the folder yourself, for example export PATH="$PATH:$HOME/.dotnet/tools".