ILSpy icon indicating copy to clipboard operation
ILSpy copied to clipboard

Central Package Management to replace packages.prop

Open clin1234 opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe. The repo's root contains packages.props, which lists versions of dependent NuGet packages used as default versions in all csprojs, unless otherwise specified in the csproj. This resembles Central Package Management, an official feature in .NET: https://devblogs.microsoft.com/nuget/introducing-central-package-management/

Describe the solution you'd like According to the link, do the following:

  1. Create a Directory.Packages.props file at the root directory, set the MSBuild property ManagePackageVersionsCentrally in the file to true.
  2. Set the PackageVersion in the props file as usual
  3. In each csproj, for each PackageReference containing a Version attribute that does not have a version number, omit the attribute.

In effect, that implies renaming packages.prop to Directory.Packages.props, moving each property that pins a package version to a normal PackageVersion tag, and moving the PackageVersion tags to a separate ItemGroup.

That also implies bumping the minimum build versions:

clin1234 avatar Jul 01 '22 17:07 clin1234

Yes, this was already on our list - but we moved it to the backburner because of the tooling requirements (we usually try to not require the hottest stuff off the presses).

christophwille avatar Jul 02 '22 06:07 christophwille

As pointed out in the dev meeting notes, this feature will be considered the earliest > 17.4 RTM (our current solution works)

christophwille avatar Jul 18 '22 06:07 christophwille

Implemented via #3124

christophwille avatar Nov 23 '23 06:11 christophwille