Usage Information
fallout-migrate built from main (@ f072c9de), .NET SDK 10.0.203, macOS. Target repo uses Central Package Management (CPM): a Directory.Packages.props with <PackageVersion> items and version-less <PackageReference> items.
Description
For repos using Central Package Management, fallout-migrate rewrites the <PackageReference Include="Nuke.Common" ...> items in the .csproj to Fallout.Common, but does not update the matching <PackageVersion Include="Nuke.Common" ...> entry in Directory.Packages.props. Under CPM the PackageReference and PackageVersion item names must match, so restore fails with NU1010.
It also leaves a stale VersionOverride="9.0.4" on the rewritten reference, a Fallout.Common version that never existed (Fallout.Common starts at 10.x).
This is related to but distinct from #217 (which fixed inline Version= attributes on PackageReference): CPM central versions in Directory.Packages.props and VersionOverride attributes are still not handled.
Reproduction Steps
- A NUKE consumer using CPM:
Directory.Packages.props contains <PackageVersion Include="Nuke.Common" Version="10.1.0"/>
- the
.csproj contains <PackageReference Include="Nuke.Common" /> (and, in our case, a second <PackageReference Include="Nuke.Common" VersionOverride="9.0.4" />)
- Run
fallout-migrate.
dotnet restore the migrated project.
Result:
error NU1010: The following PackageReference items do not define a corresponding
PackageVersion item: Fallout.Common. Projects using Central Package Management must
declare PackageReference and PackageVersion items with matching names.
Expected Behavior
After migration, a CPM repo restores. fallout-migrate renames the <PackageVersion Include="Nuke.*"> entries in Directory.Packages.props to their Fallout.* equivalents (at a valid Fallout version), and updates or removes VersionOverride attributes that reference non-existent Fallout versions.
Actual Behavior
Directory.Packages.props is left untouched (still Nuke.Common), the csproj PackageReference is now Fallout.Common with no matching PackageVersion, and a bogus VersionOverride="9.0.4" remains, so restore fails with NU1010.
Regression?
No. This is an unhandled case (CPM), not a regression. #217 addressed inline Version= pins; CPM and VersionOverride remain.
Known Workarounds
Manually rename the <PackageVersion> entries in Directory.Packages.props (Nuke.* to Fallout.* at a valid version) and fix or remove the stale VersionOverride after running the tool.
Could you help with a pull-request?
Yes.
Usage Information
fallout-migratebuilt frommain(@f072c9de), .NET SDK 10.0.203, macOS. Target repo uses Central Package Management (CPM): aDirectory.Packages.propswith<PackageVersion>items and version-less<PackageReference>items.Description
For repos using Central Package Management,
fallout-migraterewrites the<PackageReference Include="Nuke.Common" ...>items in the.csprojtoFallout.Common, but does not update the matching<PackageVersion Include="Nuke.Common" ...>entry inDirectory.Packages.props. Under CPM thePackageReferenceandPackageVersionitem names must match, so restore fails withNU1010.It also leaves a stale
VersionOverride="9.0.4"on the rewritten reference, aFallout.Commonversion that never existed (Fallout.Common starts at 10.x).This is related to but distinct from #217 (which fixed inline
Version=attributes onPackageReference): CPM central versions inDirectory.Packages.propsandVersionOverrideattributes are still not handled.Reproduction Steps
Directory.Packages.propscontains<PackageVersion Include="Nuke.Common" Version="10.1.0"/>.csprojcontains<PackageReference Include="Nuke.Common" />(and, in our case, a second<PackageReference Include="Nuke.Common" VersionOverride="9.0.4" />)fallout-migrate.dotnet restorethe migrated project.Result:
Expected Behavior
After migration, a CPM repo restores.
fallout-migraterenames the<PackageVersion Include="Nuke.*">entries inDirectory.Packages.propsto theirFallout.*equivalents (at a valid Fallout version), and updates or removesVersionOverrideattributes that reference non-existent Fallout versions.Actual Behavior
Directory.Packages.propsis left untouched (stillNuke.Common), the csprojPackageReferenceis nowFallout.Commonwith no matchingPackageVersion, and a bogusVersionOverride="9.0.4"remains, so restore fails withNU1010.Regression?
No. This is an unhandled case (CPM), not a regression. #217 addressed inline
Version=pins; CPM andVersionOverrideremain.Known Workarounds
Manually rename the
<PackageVersion>entries inDirectory.Packages.props(Nuke.*toFallout.*at a valid version) and fix or remove the staleVersionOverrideafter running the tool.Could you help with a pull-request?
Yes.