Skip to content

Implement MSBuild Central Package Management #2705

@Meir017

Description

@Meir017

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

  1. Create src/Directory.Packages.props with ManagePackageVersionsCentrally enabled
  2. Define all package versions centrally using <PackageVersion> elements
  3. Remove Version attributes from all <PackageReference> elements in project files
  4. Standardize Azure.Monitor.Query to version 1.4.0
  5. Standardize Guard.Net casing to Guard.NET
  6. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions