Skip to content

Migrate to Centralized NuGet Package Management (CPM)#81

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

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

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 26, 2026

Moves all <PackageReference> versions out of individual .csproj files into a single Directory.Packages.props at the repo root, enabling NuGet's Centralized Package Management.

Changes

  • Directory.Packages.props (new) — declares <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally> and 16 alphabetically sorted <PackageVersion> entries covering all packages across the solution
  • All .csproj filesVersion="..." removed from every <PackageReference>; all other attributes (PrivateAssets, Condition, etc.) preserved
  • Onova.slnDirectory.Packages.props added to the Misc solution folder alongside other root files (Directory.Build.props, global.json, etc.)
<!-- Before -->
<PackageReference Include="Fody" Version="6.9.3" PrivateAssets="all" />

<!-- After -->
<PackageReference Include="Fody" PrivateAssets="all" />

No version conflicts were found — every package used the same version across all projects.

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.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

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:01
Copilot AI review requested due to automatic review settings February 26, 2026 19:01
@Tyrrrz
Copy link
Copy Markdown
Owner

Tyrrrz commented Feb 26, 2026

@copilot

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 Onova repository from per-project NuGet package version management to Centralized Package Management (CPM) using a Directory.Packages.props file at the repository root. This approach consolidates all package version declarations in a single location, making it easier to maintain consistent versions across the solution.

Changes:

  • Created Directory.Packages.props with centralized version management for all 16 unique NuGet packages
  • Removed Version attributes from all <PackageReference> elements across 4 project files while preserving other attributes

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Directory.Packages.props New file defining centralized package versions with ManagePackageVersionsCentrally enabled and 16 package version declarations
Onova/Onova.csproj Removed version attributes from 8 package references while preserving PrivateAssets and Condition attributes
Onova.Updater/Onova.Updater.csproj Removed version attributes from 2 package references while preserving PrivateAssets attributes
Onova.Tests/Onova.Tests.csproj Removed version attributes from 9 package references while preserving PrivateAssets attributes
Onova.Tests.Dummy/Onova.Tests.Dummy.csproj Removed version attribute from 1 package reference while preserving PrivateAssets attribute

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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Tyrrrz
Copy link
Copy Markdown
Owner

Tyrrrz commented Feb 26, 2026

@copilot add the created Directory.Packages.props file to the sln file

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

Copilot AI commented Feb 26, 2026

@copilot add the created Directory.Packages.props file to the sln file

Done in 9aa260aDirectory.Packages.props is now listed under the Misc solution folder alongside Directory.Build.props and other root files.

@Tyrrrz Tyrrrz merged commit bea4874 into master Feb 26, 2026
5 checks passed
@codecov
Copy link
Copy Markdown

codecov bot commented Feb 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.10%. Comparing base (1f1139d) to head (9aa260a).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master      #81   +/-   ##
=======================================
  Coverage   70.10%   70.10%           
=======================================
  Files          29       29           
  Lines         572      572           
  Branches       77       77           
=======================================
  Hits          401      401           
  Misses        146      146           
  Partials       25       25           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Tyrrrz Tyrrrz deleted the copilot/migrate-to-centralized-package-management branch March 4, 2026 16:51
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