Skip to content

Migrate to Centralized NuGet Package Management (CPM)#61

Merged
Tyrrrz merged 3 commits intomasterfrom
copilot/migrate-to-centralized-package-management
Feb 26, 2026
Merged

Migrate to Centralized NuGet Package Management (CPM)#61
Tyrrrz merged 3 commits intomasterfrom
copilot/migrate-to-centralized-package-management

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 26, 2026

  • Explore repository and collect all PackageReference versions
  • Create Directory.Packages.props with centralized package versions (sorted alphabetically)
  • Remove Version="..." attributes from all .csproj files
  • Add Directory.Packages.props to the solution's Misc folder
  • Verify build still works (build succeeded, 0 errors, 0 warnings)
Original prompt

Migrate to Centralized NuGet Package Management (CPM)

Migrate the repository from per-project Version attributes on <PackageReference> to NuGet's Centralized Package Management (CPM).

What to do

  1. Create a Directory.Packages.props file at the root of the repository with <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally> and a <PackageVersion> entry for every unique package used across all .csproj files. Use the version already present in the .csproj files.

  2. Update all .csproj files to remove the Version="..." attribute from every <PackageReference> element (CPM now manages the version centrally). Keep all other attributes (e.g. PrivateAssets, Condition, ExcludeAssets, etc.) intact.

  3. Do not change any TargetFramework(s), project structure, or anything unrelated to package versioning.

Reference

See how it was done in the sibling repo Tyrrrz/YoutubeExplode PR #940: Tyrrrz/YoutubeExplode#940

Notes

  • If a package appears with different versions in different projects, use the highest version and make a note in the PR description.
  • <PackageVersion> entries in Directory.Packages.props should be sorted alphabetically.
  • Make sure the file includes a valid MSBuild props file <Project> root element.
  • Preserve all Condition attributes on <PackageReference> elements.

This pull request was created from Copilot chat.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Copilot AI changed the title [WIP] Migrate to centralized NuGet package management Migrate to Centralized NuGet Package Management (CPM) Feb 26, 2026
@Tyrrrz Tyrrrz added the enhancement New feature or request label Feb 26, 2026
@Tyrrrz Tyrrrz marked this pull request as ready for review February 26, 2026 19:27
Copilot AI review requested due to automatic review settings February 26, 2026 19:27
@Tyrrrz
Copy link
Copy Markdown
Owner

Tyrrrz commented Feb 26, 2026

@copilot please add the new props file to sln

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 26, 2026

@copilot please add the new props file to sln

Done — added Directory.Packages.props to the Misc solution folder in af937be.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request migrates the repository to NuGet's Centralized Package Management (CPM) pattern, consolidating all package version definitions from individual .csproj files into a single Directory.Packages.props file at the repository root. This change improves maintainability by ensuring consistent package versions across all projects and providing a single source of truth for dependency versions.

Changes:

  • Created Directory.Packages.props with ManagePackageVersionsCentrally enabled and all 12 package versions defined alphabetically
  • Removed Version attributes from all <PackageReference> elements across 4 .csproj files while preserving other attributes like PrivateAssets and ExcludeAssets

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Directory.Packages.props New file defining centralized versions for all 12 NuGet packages used across the solution
GitHubActionsTestLogger/GitHubActionsTestLogger.csproj Removed Version attributes from 6 package references, preserved PrivateAssets and ExcludeAssets attributes
GitHubActionsTestLogger.Tests/GitHubActionsTestLogger.Tests.csproj Removed Version attributes from 7 package references, preserved PrivateAssets attributes
GitHubActionsTestLogger.Demo.VsTest/GitHubActionsTestLogger.Demo.VsTest.csproj Removed Version attributes from 2 package references, preserved PrivateAssets attributes
GitHubActionsTestLogger.Demo.Mtp/GitHubActionsTestLogger.Demo.Mtp.csproj Removed Version attributes from 3 package references, preserved PrivateAssets attributes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

This was referenced Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants