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
Only the nearest Directory.Packages.props is evaluated per project. CPM also supports Directory.Packages.props in sub-folders — for example, test projects may have different dependencies than source code and can use a separate Directory.Packages.props in their sub-folder. A Directory.Packages.props in a sub-folder does not implicitly override or extend a parent file; it is independent and replaces the parent for projects in that folder. To share settings, explicitly chain files using MSBuild <Import> elements. See Central Package Management rules for how NuGet resolves which file applies. When in doubt about placement, ask the user.
CLI targets and CPM management scopes are different concepts. Multiple solution or project targets can use one common Directory.Packages.props, while one repository conversion can require separate files for independent project groups. Compute placement from the projects that share policy, not from the number or location of solution files.
Create the file directly so the workflow does not depend on whether the installed SDK includes the packagesprops template:
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<!-- PackageVersion items will be added here -->
</ItemGroup>
</Project>
Add a <PackageVersion> entry for each unique package, using the resolved version from the audit. Sort entries alphabetically by package ID:
<PackageVersion Include="PackageA" Version="1.2.3" />
<PackageVersion Include="PackageB" Version="4.5.6" />
If the same package needs different versions for different target frameworks, use MSBuild conditions:
Next to this one in the catalogue, plus more from the same author.