Proposal
Adopt MSBuild's Central Package Management (CPM) by creating Directory.Packages.props to manage all 60+ NuGet package versions across 18 projects from a single location.
Current State
- Each
.csproj file contains its own <PackageReference> elements with explicit version attributes
- Package versions are duplicated across multiple projects
- Version inconsistencies exist (e.g.,
Azure.Monitor.Query uses both 1.4.0 and 1.3.1)
Guard.Net casing is inconsistent across projects
Proposed Solution
- Create
src/Directory.Packages.props with ManagePackageVersionsCentrally enabled
- Define all package versions centrally using
<PackageVersion> elements
- Remove
Version attributes from all <PackageReference> elements in project files
- Standardize
Azure.Monitor.Query to version 1.4.0
- Standardize
Guard.Net casing to Guard.NET
- Keep security-pinned packages (System.Drawing.Common, System.Security.Cryptography.*) centralized with comments explaining security requirements
Benefits
✅ Single source of truth for package versions
✅ Easier version updates via Renovate
✅ Prevents version conflicts across projects
✅ Simplified maintenance for the solution
✅ Better dependency visibility for contributors
✅ Consistent versions across all 18 projects
Implementation Notes
- All 18 projects need to be updated
- Security-pinned packages will remain centrally managed with explanatory comments
- Renovate bot already supports
Directory.Packages.props by default
- Microsoft recommends this approach for multi-project solutions
References
Proposal
Adopt MSBuild's Central Package Management (CPM) by creating
Directory.Packages.propsto manage all 60+ NuGet package versions across 18 projects from a single location.Current State
.csprojfile contains its own<PackageReference>elements with explicit version attributesAzure.Monitor.Queryuses both 1.4.0 and 1.3.1)Guard.Netcasing is inconsistent across projectsProposed Solution
src/Directory.Packages.propswithManagePackageVersionsCentrallyenabled<PackageVersion>elementsVersionattributes from all<PackageReference>elements in project filesAzure.Monitor.Queryto version 1.4.0Guard.Netcasing toGuard.NETBenefits
✅ Single source of truth for package versions
✅ Easier version updates via Renovate
✅ Prevents version conflicts across projects
✅ Simplified maintenance for the solution
✅ Better dependency visibility for contributors
✅ Consistent versions across all 18 projects
Implementation Notes
Directory.Packages.propsby defaultReferences