Installation
dotnet-affected is distributed as a .NET tool.
Local tool (recommended)
Section titled “Local tool (recommended)”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.
dotnet new tool-manifestdotnet tool install dotnet-affectedThis creates (or updates) .config/dotnet-tools.json, which you should commit. On a fresh clone, restore the tools
before using them:
dotnet tool restoreGlobal tool
Section titled “Global tool”dotnet tool install --global dotnet-affectedA global install is convenient for trying the tool out, but it is not pinned per repository — different machines can end up on different versions.
Verify the installation
Section titled “Verify the installation”Run the tool from the root of your repository:
dotnet affected --helpYou should see the usage output described in the CLI reference.
Without installing: the MSBuild SDK
Section titled “Without installing: the MSBuild SDK”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.