Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Converts .NET projects and solutions to NuGet Central Package Management via Directory.Packages.props; aligns package versions across them.
Use this skill ↓36% 27%−9 ptsof test cases passed
Passed 6 of 22 test cases with the skill, and 8 of 22 without it.
3 of 3 safety checks passed
Verify the CPM conversion is version-neutral by comparing resolved package versions before and after conversion using dotnet package list. Binlogs are also captured as artifacts for manual inspection or troubleshooting.
Use the same explicit project or solution targets before and after conversion. A directory scope can require multiple targets to cover all projects. Choose one common artifact directory within the resolved scope and use explicit paths into it from every target's command directory. Always build each target from a clean state first.
Create a stable, unique <target-key> from each target's path relative to the common artifact directory when more than one target exists. Use it in that target's artifact names so one target cannot overwrite another:
baseline.binlog, after-cpm.binlog, baseline-packages.json, and after-cpm-packages.json.baseline-<target-key>.binlog, after-cpm-<target-key>.binlog, baseline-packages-<target-key>.json, and after-cpm-packages-<target-key>.json.Complete the full baseline sequence for every target before editing any file. Complete the full post-conversion sequence for every target after all edits.
Run dotnet --version once from each target's command directory and select that target's package-list syntax by SDK version instead of probing with commands that may fail:
dotnet package list --project <scope> --format json --include-transitive --no-restore.dotnet list <scope> package --format json --include-transitive --no-restore..slnx scope requires SDK 9.0.201 or later so build, restore, and package-list operations all support the format. If it is unsupported, stop and report the prerequisite.If dotnet --version fails, do not try roll-forward overrides, install an SDK, create a temporary global.json, or invoke SDK assemblies directly. Report the SDK required by the existing global.json or project and stop.
Set <baseline-binlog>, <after-binlog>, <baseline-packages>, and <after-packages> below to explicit paths in the common artifact directory, using the target-keyed names when applicable.
dotnet clean <scope>
dotnet restore <scope>
dotnet build <scope> --no-restore -bl:<baseline-binlog>
Then run exactly one package-list command for the active SDK:
# SDK 10 or later
dotnet package list --project <scope> --format json --include-transitive --no-restore > <baseline-packages>
Next to this one in the catalogue, plus more from the same author.