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
This covers how to handle MSBuild properties that define package versions (for example, Version="$(PackageVersionProperty)") during CPM conversion.
If keeping a property reference in Directory.Packages.props (e.g., Version="$(PackageAVersion)"), the property must be defined in a file that MSBuild evaluates before Directory.Packages.props. Properties in Directory.Build.props satisfy this requirement because MSBuild imports Directory.Build.props before Directory.Packages.props.
For each PackageReference that used an MSBuild property for its version:
Search all project files, .props, and .targets files in scope for references to the property name:
# Unix/macOS
grep -r '$(PropertyName)' --include='*.csproj' --include='*.props' --include='*.targets' .
# Windows (PowerShell)
Get-ChildItem -Recurse -Include *.csproj,*.props,*.targets | Select-String '$(PropertyName)'
If it appears only in PackageReference version attributes, it is safe to remove after inlining.
If the property is defined in a file within scope (e.g., Directory.Build.props), ask the user whether to:
Directory.Packages.props and remove the property definition before final validation, after verifying no references remainDirectory.Packages.props (e.g., <PackageVersion Include="PackageA" Version="$(PackageAVersion)" />)If the property is used beyond package versioning, do not remove it. Use the property's resolved value in Directory.Packages.props and inform the user.
If the property is defined outside the conversion scope (e.g., in parent repository build infrastructure), stop before editing that package. Ask the user to choose one safe option:
Next to this one in the catalogue, plus more from the same author.