Description
Convert this repository to use NuGet CentralPackageManagement with transitive pinning enabled.
https://learn.microsoft.com/en-us/nuget/consume-packages/Central-Package-Management
Create a root Directory.Packages.props with PackageVersion items for all packages used by this repository. Those should use the properties defined in Versions.props if present.
Remove the Version attribute from all PackageReference items. If any projects have a different version used than then centrally specified version, then preserve that version by using a VersionOverride attribute.
If possible, remove extraneous PackageReferences if those are already referenced by the package indirectly. Indirect package references can be seen by examining the project.assets.json
after restoring the project. If a package is listed as a dependency
of another package in this file, then the direct reference may be removed. The project.assets.json for a project is located under ./artifacts/obj
followed by the project name without extension. For example, the project.assets.json
for Microsoft.ML.csproj
is in ./artfiacts/obj/Microsoft.ML/project.assets.json
.
Projects can be restored by running dotnet restore
directly on the project, or using ./eng/common/build.sh -restore
to restore all projects at once.
Once done with this work, compare the libraries resolved before and after for every project.assets.json
. The same libraries and versions should be restored after the change as were restored before the change.