CPMigrate 2.10.2

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global CPMigrate --version 2.10.2
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local CPMigrate --version 2.10.2
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=CPMigrate&version=2.10.2
                    
nuke :add-package CPMigrate --version 2.10.2
                    

CPMigrate: The Ultimate .NET Central Package Management (CPM) Migration Tool

<div align="center"> <img src="./docs/images/logo.png" alt="CPMigrate Logo" width="128" /> <br/> <img src="./docs/images/banner.png" alt="CPMigrate Banner" width="100%" /> </div>

<div align="center">

.NET License: MIT NuGet Downloads

</div>

CPMigrate Interactive Wizard

🚀 Why CPMigrate?

Stop wrestling with dependency hell and version drift. CPMigrate is the advanced CLI tool that instantly modernizes your .NET solutions to use NuGet Central Package Management (CPM).

It doesn't just move XML around; it is a full-featured repository health auditor that:

  • Analyzes your entire dependency graph.
  • Resolves deep version conflicts automatically.
  • Cleans redundant <PackageReference> entries to reduce technical debt.
  • Secures your codebase by detecting high-severity vulnerabilities before they are locked in.

✨ Key Features & Capabilities

đŸ›Ąī¸ Intelligent Dependency Management

  • Transitive Conflict Resolution: Automatically detects and resolves deep dependency conflicts that dotnet restore often misses.
  • Dependency Lifting (Cleanup): Identifies redundant explicit package references that are already transitively provided, keeping your .csproj files clean and minimal.
  • Smart Versioning Strategies: Choose between Highest, Lowest, or Fail strategies to handle version mismatches across your repository.

🔒 Security-First Architecture

  • Automated Vulnerability Audits: Runs integrated security scans (dotnet list package --vulnerable) to prevent locking in insecure packages.
  • Secure Execution: Strict path resolution prevents PATH injection attacks.
  • Supply Chain Hardening: CI/CD workflows are pinned to secure hashes to prevent upstream compromises.

🚀 Modern Development Workflow

  • SLNX Support: Fully compatible with the new Visual Studio 17.10+ .slnx solution format.
  • Directory.Build.props Unification: Automatically promotes repeated properties (Authors, TargetFramework, etc.) to a root-level configuration file, enforcing consistency across 100+ projects instantly.
  • Self-Updating: Includes a built-in update checker to ensure you're always using the latest version of the tool.
    • cpmigrate --update

🎮 Mission Control Dashboard

An immersive, keyboard-driven Terminal User Interface (TUI) that provides:

  • Real-time Risk Assessment: Scans your repo and calculates a "Migration Risk" score.
  • Dry-Run Previews: Visualize massively destructive changes before they happen.
  • Live Verification: Automatically verifies build integrity after every migration step.

đŸ“Ļ Installation & Updating

Requires .NET SDK 8.0 or later (supports .NET 10).

Install:

dotnet tool install --global CPMigrate

Update: You can let the tool update itself:

cpmigrate --update

Or manually via .NET CLI:

dotnet tool update --global CPMigrate

Note: NuGet indexing may take up to 15 minutes after a new release. Clear your HTTP cache if updates aren't found immediately: dotnet nuget locals http-cache --clear

From Source

git clone https://github.com/georgepwall1991/CPMigrate.git
cd CPMigrate
dotnet build

đŸ•šī¸ Usage Scenarios

1. The "Mission Control" (Interactive Mode)

Ideal for first-time users or complex repositories.

cpmigrate
  • Drives the entire process via a step-by-step wizard.
  • Offers rollbacks, backups, and detailed explanations.

2. CI/CD & Automation (Headless Mode)

Perfect for GitHub Actions, Azure DevOps, or Git hooks.

Migrate a specific solution:

cpmigrate -s ./MySolution.sln

Analyze repository health (No changes):

cpmigrate --analyze

Auto-fix common issues (No migration):

cpmigrate --analyze --fix

3. Repository Modernization

Refactor your entire codebase structure in one command.

Unify generic properties to Directory.Build.props:

cpmigrate --unify-props

Batch migrate a monorepo with 50+ solutions:

cpmigrate --batch /path/to/repo --batch-parallel

Options Reference

Option Short Description
--interactive -i Launch the Mission Control TUI (Default if no args).
--solution -s Path to .sln or .slnx file or directory.
--unify-props - Migrate common project properties to Directory.Build.props.
--dry-run -d Simulate operations without writing files.
--analyze -a Run health checks (duplicates, security, transitive).
--fix - Apply automatic fixes to discovered analysis issues.
--rollback -r Restore the last backup state.
--prune-backups - Clean up old backup files to save space.
--output - Output format: Terminal (default) or Json (for CI pipes).

Mission Control Dashboard

CPMigrate Interactive The state-driven dashboard assessing migration risk.

Risk Analysis & Dry Run

CPMigrate Demo Previewing massive changes safely before committing.

Security & Package Analysis

CPMigrate Analyze Scanning for vulnerabilities and redundant dependencies.


🤝 Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

Distributed under the MIT License. See LICENSE for more information.

👤 Author

George Wall

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
3.3.0 109 2/2/2026
3.2.0 104 2/1/2026
3.1.0 102 2/1/2026
3.0.0 102 2/1/2026
2.10.3 103 2/1/2026
2.10.2 106 2/1/2026
2.9.1 103 1/27/2026
2.9.0 100 1/27/2026
2.8.1 104 2/1/2026
2.8.0 93 1/25/2026
2.7.5 195 12/20/2025
2.7.3 169 12/20/2025
2.7.0 166 12/19/2025
2.6.3 188 12/19/2025
2.6.2 177 12/19/2025
2.6.1 169 12/19/2025
2.6.0 180 12/19/2025
2.5.2 174 12/19/2025
2.5.1 176 12/19/2025
2.5.0 176 12/19/2025
Loading failed