Skip to content
v7 is in preview. Install it with dotnet tool install dotnet-affected --prerelease, and see what changed since v6.

Installation

dotnet-affected is distributed as a .NET tool.

Installing it as a local tool records the version in your repository’s tool manifest, so every developer and every CI run uses the same version.

Terminal window
dotnet new tool-manifest
dotnet tool install dotnet-affected

This creates (or updates) .config/dotnet-tools.json, which you should commit. On a fresh clone, restore the tools before using them:

Terminal window
dotnet tool restore
Terminal window
dotnet tool install --global dotnet-affected

A global install is convenient for trying the tool out, but it is not pinned per repository — different machines can end up on different versions.

Run the tool from the root of your repository:

Terminal window
dotnet affected --help

You should see the usage output described in the CLI reference.

dotnet-affected can also run directly from MSBuild, without installing the CLI, using the DotnetAffected.Tasks SDK. MSBuild restores it like any other package, so there is nothing to install up front.