madelson / DistributedLock

A .NET library for distributed synchronization
MIT License
1.74k stars 182 forks source link

Adopt central package management #179

Closed madelson closed 3 months ago

madelson commented 6 months ago

See https://learn.microsoft.com/en-us/nuget/consume-packages/central-package-management

Bartleby2718 commented 4 months ago

@madelson To what extent do you want to leverage CPM? If you take this to the extreme, you could imagine putting all NuGet packages in Directory.Packages.props, even for those that are used only in one project (e.g. StackExchange.Redis is used only in DistributedLock.Redis.csproj). If you want to leverage CPM minimally, on the other hand, then you can also put only the common ones like Microsoft.SourceLink.GitHub in Directory.Packages.props.

Bartleby2718 commented 4 months ago

Welp, turns out you can't leverage CPM "minimally." You'll get

error NU1008: Projects that use central package version management should not define the version on the PackageReference items

if you try to.