What problem does it solve?
It solves inconsistent and duplicated MSBuild settings across many .csproj files by providing a clear, correct way to centralize properties, items, build logic, and NuGet package versions.
Core Features & Use Cases
- Use the right file for the right job: apply defaults and item definitions in Directory.Build.props, and late-bound or conditional logic in Directory.Build.targets.
- Enable NuGet Central Package Management (CPM): manage package versions once via Directory.Packages.props and remove Version= duplication from individual projects.
- Support multi-level repo hierarchies: chain directory build files with GetPathOfFileAbove so src/, test/, and other folders can safely inherit and override repo-wide settings.
- Avoid a common MSBuild pitfall: prevents incorrect use of $(TargetFramework) conditions in .props files for single-target projects (moving such logic to .targets).
- Operational use: standardize compilation settings, analyzers, artifact output layout, and validation checks across a multi-project .NET repository.
Quick Start
Ask an AI to propose a repo-wide Directory.Build.props, Directory.Build.targets, and Directory.Packages.props plan for your solution, including what to centralize, what to keep per-project, and where to place any $(TargetFramework)-conditioned properties.