Build and test only the projects your changes actually affect.
A .NET tool that works out which MSBuild projects a set of changes affects, so large repositories and monorepos can build and test a fraction of themselves instead of all of it.
It compares your working tree against a baseline commit, maps the changed files to the projects that reference them, and walks the MSBuild project graph to find everything that depends on them.
dotnet new tool-manifest
dotnet tool install dotnet-affected$ dotnet affected --from origin/main --uncommitted none
WRITE: /repo/affected.projaffected.proj is an MSBuild Traversal
project, so it behaves like a solution:
dotnet build affected.proj
dotnet test affected.projWhen nothing changed, no file is written and the tool exits 166 — check for it and skip the rest of
the pipeline.
| Getting started | Install, first run, how it works |
| Guides | Discovery, output formats, exclusions, NuGet changes |
| CLI reference | Every option and exit code |
| MSBuild SDK | Run it from MSBuild, without the CLI |
| GitHub Action | Run it in GitHub Actions |
| Upgrading to v7 | What changed, and what to update |
- Detects which projects changed, from any file they reference — not just source files.
- Detects NuGet package changes when using Central Package Management.
- Picks up
Directory.Build.props/.targetsand other imported files. - Outputs a Traversal project, a Solution Filter, plain text or JSON.
- Supports
.csproj,.fsprojand.vbproj, SDK and non-SDK style.
Issues and pull requests are welcome. See Building the project to get set up.