This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
[Build] Centrally manage NuGet package versions #4180
Labels
You can continue the conversation there. Go to discussion →
Describe the problem this feature would solve
NuGet package references are spread across project files. It is difficult to track versions and upgrade them properly. It would be simple and easier to manage the versions and the packages centrally, if there were a way to store versions, separately in a central location, away from the project files. In the future, you could also separate testing versions from shipping versions and use them in CI build intelligently. But this would require re-organizing the project's folder structure. If this works, I'll open a proposal to re-organize the projects to effectively use modern build features that are at our disposal.
Describe the solution
Use NuGet's upcoming feature to manage package versions centrally using
Directory.Packages.props
with the following item spec to store a package version.Then, all you need to remove the version tag/attribute from all the project files, like so...
Describe alternatives you've considered
There is a
Microsoft.Build.CentralPackageVersions
, an MSBuild SDK which is a part of MSBuild SDKs maintained by @jeffkl. But for simple scenarios like ours, I've decided to go with the built-in support from NuGet's feature. It enables us to dogfood the feature and give feedback to the NuGet team.Additional context & Screenshots
Know more about NuGet's Central Package Version Management (CPVM) feature.
The text was updated successfully, but these errors were encountered: