-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Consider adding -dependencyVersion support for project.json/package reference install and update #3159
Labels
Functionality:Restore
Priority:3
Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog.
Resolution:Duplicate
This issue appears to be a Duplicate of another issue
Type:Feature
Milestone
Comments
joelverhagen
changed the title
Consider adding -dependencyVersion support for project.json install and update
Feature: Consider adding -dependencyVersion support for project.json install and update
Jul 18, 2016
nkolev92
changed the title
Feature: Consider adding -dependencyVersion support for project.json install and update
Feature: Consider adding -dependencyVersion support for project.json/package reference install and update
Mar 15, 2017
We probably don't want to verbatim implement this, but as joel mentioned, certainly something we need to give some thought. |
nkolev92
added
Priority:3
Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog.
Functionality:Restore
and removed
Priority:2
Issues for the current backlog.
Platform:Xplat
labels
Jan 16, 2019
Related to #5553 |
Dup of #5553 |
nkolev92
added
the
Resolution:Duplicate
This issue appears to be a Duplicate of another issue
label
May 1, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Functionality:Restore
Priority:3
Issues under consideration. With enough upvotes, will be reconsidered to be added to the backlog.
Resolution:Duplicate
This issue appears to be a Duplicate of another issue
Type:Feature
Today we have the
-dependencyVersion
option on PMC install and update as well as thedependencyVersion
option in the config. It only applies to packages.config.We could introduce support to project.json world by lifting transitive dependencies to the parent project.
Example
Consider you have a project.json and you want to install WindowsAzure.Storage 6.2.0. This package depends on Newtonsoft.Json 6.0.8. Today if you install WindowsAzure.Storage, you will get a project.json like this:
In the lock file, NuGet would have resolved the lowest version that meets the dependency's spec, which means that Newtonsoft.Json 6.0.8 would be restored.
With
DependencyBehavior.Highest
, the highest version of Newtonsoft.Json should be picked (which is 9.0.1 today). Since project.json default behavior is taking the lowest, we could observe thisDependencyBehavior.Highest
option by lifting Newtonsoft.Json 9.0.1 to the project.json automatically, resulting in a project.json that looks like this:-dependencyVersion in restore?
Lifting dependencies to the parent is one possibility, but this causes the user's project to become crowded with a potentially huge number of transitive dependencies (just look at the full graph of NETStandard.Library metapackage).
Another approach would be to support -dependencyVersion in restore itself so that, as NuGet walks transitive dependencies, it picks Highest instead of Lowest as it goes. This is a significant behavior change in project.json and, as @emgarten notes, this can lead to wacky results especially with CoreFX packages that change a lot from one minor release to the next.
More thought and design needed.
The text was updated successfully, but these errors were encountered: