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
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
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
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
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 Mar 25, 2026
github-actions bot pushed a commit to IntelliTect/EssentialCSharp.ListingManager that referenced this pull request Mar 26, 2026
Updated
[GitHubActionsTestLogger](https://github.com/Tyrrrz/GitHubActionsTestLogger)
from 3.0.1 to 3.0.2.

<details>
<summary>Release notes</summary>

_Sourced from [GitHubActionsTestLogger's
releases](https://github.com/Tyrrrz/GitHubActionsTestLogger/releases)._

## 3.0.2

## What's Changed
* Bump the nuget group with 4 updates by @​dependabot[bot] in
Tyrrrz/GitHubActionsTestLogger#59
* Bump the nuget group with 1 update by @​dependabot[bot] in
Tyrrrz/GitHubActionsTestLogger#60
* Migrate to Centralized NuGet Package Management (CPM) by @​Copilot in
Tyrrrz/GitHubActionsTestLogger#61
* Use range indexer in `SubstringAfterLast` by @​Copilot in
Tyrrrz/GitHubActionsTestLogger#62
* Bump the nuget group with 7 updates by @​dependabot[bot] in
Tyrrrz/GitHubActionsTestLogger#63
* Fix build errors from obsolete MTP API usage by @​Copilot in
Tyrrrz/GitHubActionsTestLogger#64
* Remove explicit Microsoft.SourceLink.GitHub package reference by
@​Copilot in Tyrrrz/GitHubActionsTestLogger#65
* Add strong naming by @​mgravell in
Tyrrrz/GitHubActionsTestLogger#67

## New Contributors
* @​Copilot made their first contribution in
Tyrrrz/GitHubActionsTestLogger#61
* @​mgravell made their first contribution in
Tyrrrz/GitHubActionsTestLogger#67

**Full Changelog**:
Tyrrrz/GitHubActionsTestLogger@3.0.1...3.0.2

Commits viewable in [compare
view](Tyrrrz/GitHubActionsTestLogger@3.0.1...3.0.2).
</details>

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=GitHubActionsTestLogger&package-manager=nuget&previous-version=3.0.1&new-version=3.0.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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