You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/concepts/Dependency-Resolution.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,22 +65,22 @@ When using a floating version, NuGet resolves the highest version of a package t
65
65
When the package graph for an application contains different versions of a package in the same subgraph, and one of those versions is a direct dependency in that subgraph, that version would be chosen for that subgraph and the rest will be ignored.
66
66
This behavior allows an application to override any particular package version in the dependency graph.
67
67
68
-
In the example below, the application depends directly on Package B with a version constraint of >=2.0. The application also depends on Package A which in turn also depends on Package B, but with a >=1.0 constraint. Because the dependency on Package B 2.0 is direct dependency to the application in the graph, that version is used:
68
+
In the example below, the application depends directly on Package B with a version constraint of >=2.0.0. The application also depends on Package A which in turn also depends on Package B, but with a >=1.0.0 constraint. Because the dependency on Package B 2.0.0 is direct dependency to the application in the graph, that version is used:
69
69
70
70

71
71
72
72
>[!Warning]
73
73
> The Direct dependency wins rule can result in a downgrade of the package version, thus potentially breaking other dependencies in the graph. When a package is downgraded, NuGet adds a [warning to alert the user](..\reference\errors-and-warnings\NU1605.md).
74
74
75
75
This rule also results in greater efficiency with a large dependency graph.
76
-
When a closer dependency in the same subgraph has a higher version than a further one, then NuGet ignores that dependency, NuGet also ignores all remaining dependencies on that branch of the graph.
76
+
When a closer dependency in the same subgraph has a higher version than a further one, then NuGet ignores that dependency, and NuGet also ignores all remaining dependencies on that branch of the graph.
77
77
78
-
In the diagram below, for example, because Package C 2.0 is used, NuGet ignores any branches in that subgraph that refer to an earlier version of Package C:
78
+
In the diagram below, for example, because Package C 2.0.0 is used, NuGet ignores any branches in that subgraph that refer to an earlier version of Package C:
79
79
80
80

81
81
82
82
Through this rule, NuGet tries to honor the intent of the package author.
83
-
In the diagram below, the author of Package A has explicitly downgraded to Package C 1.0.0 from Package B 2.0.0.
83
+
In the diagram below, the author of Package A has explicitly downgraded to Package C 1.0.0 from Package C 2.0.0.
84
84
85
85

86
86
@@ -90,15 +90,15 @@ The application owner can choose to upgrade Package C to a version higher than 2
90
90
91
91
#### Cousin dependencies
92
92
93
-
When different package versions are referred in different subgraphs in the graph from the application, NuGet uses the lowest version that satisfies all version requirements (as with the [lowest applicable version](#lowest-applicable-version) and [floating versions](#floating-versions) rules). In the image below, for example, version 2.0 of Package B satisfies the other >=1.0 constraint, and is thus used:
93
+
When different package versions are referred in different subgraphs in the graph from the application, NuGet uses the lowest version that satisfies all version requirements (as with the [lowest applicable version](#lowest-applicable-version) and [floating versions](#floating-versions) rules). In the image below, for example, version 2.0.0 of Package B satisfies the other >=1.0.0 constraint, and is thus used:
94
94
95
95

96
96
97
97
Note that the packages do not need to be on the same distance for the cousin dependencies rule to apply. In the diagram below, Package D 2.0.0 is chosen in the Package C subgraph and Package D 3.0.0 is chosen in the subgraph of Package A. In the Application subgraph, there is no direct dependency to Package D, so the the [lowest applicable version](#lowest-applicable-version) rule is applied and version 3.0.0 is chosen.
98
98
99
99

100
100
101
-
In some cases, it's not possible to meet all version requirements. As shown below, if Package A requires exactly Package B 1.0 and Package C requires Package B >=2.0, then NuGet cannot resolve the dependencies and gives an error.
101
+
In some cases, it's not possible to meet all version requirements. As shown below, if Package A requires exactly Package B 1.0.0 and Package C requires Package B >=2.0.0, then NuGet cannot resolve the dependencies and gives an error.
102
102
103
103

0 commit comments