Installation Guide

dotnet-test-rerun can be installed in multiple ways depending on your needs and environment.

Prerequisites

  • .NET SDK 8.0, 9.0, or 10.0
  • A .NET test project (compatible with dotnet test)

Install dotnet-test-rerun as a global .NET tool:

dotnet tool install --global dotnet-test-rerun

After installation, the tool will be available globally as test-rerun:

test-rerun --help

Updating the Global Tool

To update to the latest version:

dotnet tool update --global dotnet-test-rerun

Uninstalling the Global Tool

To remove the tool:

dotnet tool uninstall --global dotnet-test-rerun

Method 2: Local Tool

Install as a local tool in your project or solution:

Step 1: Initialize a tool manifest (if not already present)

dotnet new tool-manifest

Step 2: Install the local tool

dotnet tool install dotnet-test-rerun

Step 3: Run the local tool

dotnet tool run test-rerun -- --help

Or use the shorter form:

dotnet test-rerun --help

Method 3: Docker

Use the pre-built Docker images for containerized environments:

docker pull joaoopereira/dotnet-test-rerun:latest

See the Docker Guide for more details on using Docker images.

Method 4: NuGet Package Reference

While not typically needed for end-users, you can also reference the NuGet package directly in your project if you want to programmatically integrate the tool:

<ItemGroup>
  <PackageReference Include="dotnet-test-rerun" Version="*" />
</ItemGroup>

Verifying Installation

After installation, verify the tool is working correctly:

test-rerun --help

You should see output showing all available options and usage information.

Version Check

To check which version is installed:

dotnet tool list --global | grep dotnet-test-rerun

Or for local tools:

dotnet tool list

Troubleshooting

“Command not found” Error

If you get a “command not found” error after installing as a global tool:

  1. Ensure the .NET tools directory is in your PATH:
    • Windows: %USERPROFILE%\.dotnet\tools
    • Linux/macOS: $HOME/.dotnet/tools
  2. Restart your terminal/shell

  3. Check if the tool is installed:
    dotnet tool list --global
    

Permission Issues

If you encounter permission issues on Linux/macOS:

sudo dotnet tool install --global dotnet-test-rerun

Or install to a user directory without requiring sudo.

.NET SDK Version Mismatch

If you get errors about .NET SDK versions:

  1. Check your installed SDK versions:
    dotnet --list-sdks
    
  2. Ensure you have .NET 8.0, 9.0, or 10.0 installed

  3. Update your .NET SDK if necessary from dotnet.microsoft.com

Next Steps


Back to top

Copyright © 2023-2024 João Pereira. Distributed under the GNU General Public License v3.0.