dotnet-affected
7.0.1
dotnet tool install --global dotnet-affected --version 7.0.1
dotnet new tool-manifest
dotnet tool install --local dotnet-affected --version 7.0.1
#tool dotnet:?package=dotnet-affected&version=7.0.1
nuke :add-package dotnet-affected --version 7.0.1
<h1 align="center">dotnet-affected</h1>
<p align="center"> Build and test only the projects your changes actually affect. </p>
<p align="center"> <a href="https://www.nuget.org/packages/dotnet-affected"> <img src="https://img.shields.io/nuget/v/dotnet-affected?logo=nuget&label=dotnet-affected" alt="NuGet"></a> <a href="https://www.nuget.org/packages/DotnetAffected.Tasks"> <img src="https://img.shields.io/nuget/v/DotnetAffected.Tasks?logo=nuget&label=DotnetAffected.Tasks" alt="NuGet"></a> <a href="https://www.nuget.org/packages/dotnet-affected"> <img src="https://img.shields.io/nuget/dt/dotnet-affected?label=downloads" alt="Downloads"></a> <a href="https://github.com/leonardochaia/dotnet-affected/actions/workflows/dotnet.yml"> <img src="https://github.com/leonardochaia/dotnet-affected/actions/workflows/dotnet.yml/badge.svg" alt="Build"></a> <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT"></a> </p>
<p align="center"> <b><a href="https://dotnet-affected.com">📖 Documentation</a></b> </p>
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.
Install
dotnet new tool-manifest
dotnet tool install dotnet-affected
Use
$ dotnet affected --from origin/main --uncommitted none
WRITE: /repo/affected.proj
affected.proj is an MSBuild Traversal
project, so it behaves like a solution:
dotnet build affected.proj
dotnet test affected.proj
When nothing changed, no file is written and the tool exits 166 — check for it and skip the rest of
the pipeline.
Documentation
| 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 |
Features
- 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.
Contributing
Issues and pull requests are welcome. See Building the project to get set up.
License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.
| Version | Downloads | Last Updated |
|---|---|---|
| 7.0.1 | 43,963 | 10/7/2026 |
| 7.0.0 | 5,166 | 10/6/2026 |
| 7.0.0-preview.1 | 11,174 | 8/17/2026 |
| 6.2.0 | 668,521 | 3/3/2026 |
| 6.2.0-preview-1 | 26,539 | 11/19/2025 |
| 6.1.0 | 362,942 | 8/26/2025 |
| 6.1.0-preview-1 | 1,607 | 7/28/2025 |
| 6.0.0 | 67,855 | 7/18/2025 |
| 6.0.0-preview-1 | 111,467 | 12/10/2024 |
| 5.0.0 | 372,111 | 10/25/2024 |
| 4.0.1 | 21,150 | 9/26/2024 |
| 4.0.0 | 1,912,240 | 1/15/2024 |
| 3.2.0 | 135,571 | 7/12/2023 |
| 3.1.1 | 77,741 | 3/9/2023 |
| 3.1.0 | 1,594 | 3/6/2023 |
| 3.0.0 | 123,899 | 3/2/2023 |
| 3.0.0-preview-4 | 742 | 1/2/2023 |
| 3.0.0-preview-3 | 642 | 10/14/2022 |
| 3.0.0-preview-2 | 608 | 9/6/2022 |
| 3.0.0-preview-1 | 570 | 7/30/2022 |