The centralized package system is NOW at:
/home/runner/work/ad-blocking/ad-blocking/Directory.Packages.props
- Total Packages Managed: 57
- Projects Using It: All 12 .NET projects
- Version Conflicts: 0
- Format: MSBuild XML with Central Package Management (CPM)
cat Directory.Packages.propscd src/adguard-api-dotnet
dotnet list package-
Add to
Directory.Packages.props:<PackageVersion Include="NewPackage" Version="1.2.3" />
-
Reference in project (without version):
<PackageReference Include="NewPackage" />
-
Restore:
dotnet restore
-
Edit
Directory.Packages.props:<PackageVersion Include="Polly" Version="8.7.0" />
-
Restore all projects:
dotnet restore
dotnet list package --outdatedgrep -r "PackageReference Include=\"Polly\"" src/ --include="*.csproj"All configuration, DI, hosting, logging, and options packages
All EF Core providers and design tools
- xunit: v2.9.3
- Moq: v4.20.72
- Test SDK: v18.0.1
- FluentAssertions: v6.12.1
- Polly: v8.6.5
- Spectre.Console: v0.54.0
- YamlDotNet: v16.3.0
- Tomlyn: v0.19.0
- Update versions in
Directory.Packages.propsonly - Keep package families at the same version (Microsoft.Extensions, EF Core)
- Run
dotnet restoreafter version changes - Use semantic versioning
- Document breaking changes
- Add
Versionattribute to<PackageReference>in.csprojfiles - Create new
Directory.Packages.propsfiles in subdirectories - Mix versions within package families
- Skip testing after major version updates
Fix: Add to Directory.Packages.props:
<PackageVersion Include="X" Version="1.0.0" />Fix: Remove Version="..." from <PackageReference> in .csproj
- Clean:
dotnet clean - Restore:
dotnet restore - Build:
dotnet build
Verify the package name matches exactly (case-sensitive)
- Full Guide: docs/centralized-package-management.md
- Migration Summary (archived): docs/archive/centralized-package-migration-summary.md
- Microsoft Docs: Central Package Management
| Metric | Before | After |
|---|---|---|
| Package files | 3 | 1 |
| Version conflicts | 8 | 0 |
| Projects with explicit versions | 4 | 0 |
| Update complexity | High | Low |
<!-- In Directory.Packages.props -->
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="10.0.1" />
<!-- In MyProject.csproj -->
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" /><!-- Update once in Directory.Packages.props - affects all projects -->
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="10.0.2" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="10.0.2" />
<!-- ... all others to 10.0.2 ... --># See which projects use Polly
grep -l "Polly" src/**/*.csproj
# Output:
# src/adguard-api-dotnet/src/AdGuard.ApiClient/AdGuard.ApiClient.csprojNo changes needed! The centralized system is automatically detected by:
dotnet restoredotnet build- GitHub Actions workflows
- Visual Studio / VS Code
- Rider
- Restore time: Same as before (no overhead)
- Build time: Same as before
- Maintenance time: 86% faster for version updates
One file, one version, all projects.
That's the power of centralized package management.
Last Updated: December 15, 2025
Status: ✅ Active and verified