CPM - Provide option to explicitly use version tags #12803
Labels
Area:RestoreCPM
Central package management
Functionality:Restore
Priority:3
Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog.
Type:DCR
Design Change Request
NuGet Product(s) Affected
NuGet.exe, Visual Studio Package Management UI, Visual Studio Package Manager Console
Current Behavior
Currently, when CPM is used and new NuGet packages are added to a solution, the
Version
attribute is added to thePackageVersion
in theDirectory.Packages.props
file.When it comes to git usage, this causes issues when dependency updating tools such as Dependabot are used, because git uses the line before and after to detect changes. If consecutive packages are updated in the same Dependabot run, this will cause merge conflicts, which require manual intervention to fix.
Desired Behavior
The git conflicts are really easy to fix by explicitly using version tags in the package reference, like so:
When adding new packages to a solution, we have to remember to manually amend the package references to this format. It would be better if we could specify a flag that would enforce NuGet to use the explicit version tags automatically, instead of using the inline attribute string.
A property such as
UseExplicitPackageVersionTags
could be used to enable this behaviour.Additional Context
This would improve the developer experience for CPM users, where package update processes are in place.
The text was updated successfully, but these errors were encountered: