convert-to-cpm

Convert .NET projects to NuGet Central Package Management with Directory.Packages.props.

Updated Jul 12, 2026
One-click install
npx skills add https://github.com/Patrick-Rex/DotNetTechSamples --skill convert-to-cpm-patrick-rex
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: convert-to-cpm
Source: https://github.com/Patrick-Rex/DotNetTechSamples/tree/main/.agents/plugins/dotnet-nuget/skills/convert-to-cpm
Command: npx skills add https://github.com/Patrick-Rex/DotNetTechSamples --skill convert-to-cpm-patrick-rex

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Package versions scattered across many .csproj, .fsproj, and .vbproj files drift out of sync, causing version conflicts, inconsistent builds, and painful upgrades across multi-project repositories. ## Core Features & Use Cases - CPM Migration: Converts projects, solutions (.sln/.slnx), or entire repositories to Central Package Management by generating a Directory.Packages.props file and stripping Version attributes from PackageReference items. - Version Conflict Resolution: Audits all package references, detects conflicting versions across projects, and guides the user through resolution strategies such as aligning to the highest version or using VersionOverride. - Baseline Validation and Reporting: Captures pre- and post-conversion binlogs and package lists, compares resolved versions, and produces a shareable convert-to-cpm.md report with risk assessment and follow-up items. - Use Case: A repository with 15 projects referencing System.Text.Json at three different versions can be converted so all versions are centralized in one file, conflicts are resolved with user approval, and the build is verified version-neutral. ## Quick Start Convert my solution MyApp.sln to NuGet Central Package Management and resolve any package version conflicts.

Frequently Asked Questions about convert-to-cpm

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert a .NET solution to Central Package Management?

Central Package Management conversion creates a Directory.Packages.props file with ManagePackageVersionsCentrally enabled, adds a PackageVersion entry per package, and removes Version attributes from each PackageReference. The skill validates the build before and after conversion.

How do I resolve NuGet package version conflicts across multiple projects?

Version conflicts are resolved by aligning all projects to the highest version already in use, aligning to the lowest, or using VersionOverride for projects that must keep a different version. Each conflict is presented individually with its trade-offs for the user to decide.

Can I use Central Package Management with packages.config projects?

No, CPM only works with PackageReference-based projects. Projects using packages.config must first be migrated to PackageReference using Visual Studio's migration tooling or dotnet migrate before CPM conversion can proceed.

What do NuGet errors NU1008 and NU1010 mean during CPM migration?

NU1008 means a PackageReference still has a Version attribute while CPM is enabled, so remove it or use VersionOverride. NU1010 means a PackageReference lacks a corresponding PackageVersion entry in Directory.Packages.props, which must be added.

Does CPM conversion change my resolved package versions?

The conversion is designed to be version-neutral: baseline and post-conversion package lists are captured with dotnet package list and compared per project. Any intentional changes from conflict resolution are documented in the convert-to-cpm.md report.

How are MSBuild version properties handled in Directory.Packages.props?

Properties used only for package versions can be inlined as literal versions in Directory.Packages.props and then removed, or kept as property references if defined in Directory.Build.props, which MSBuild evaluates first. Properties used elsewhere are never removed.