Skip to content

Commit 2a8ca03

Browse files
authored
Update Dependency-Resolution.md (#3152)
1 parent a938668 commit 2a8ca03

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/concepts/Dependency-Resolution.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,22 +65,22 @@ When using a floating version, NuGet resolves the highest version of a package t
6565
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.
6666
This behavior allows an application to override any particular package version in the dependency graph.
6767

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:
6969

7070
![Application using the Direct dependency wins rule](media/direct-dependency-1.png)
7171

7272
>[!Warning]
7373
> 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).
7474
7575
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.
7777

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:
7979

8080
![When NuGet ignores a package in the graph, it ignores that entire branch](media/direct-dependency-2.png)
8181

8282
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.
8484

8585
![When a package author explicitly downgrades, NuGet honors that.](media/direct-dependency-3.png)
8686

@@ -90,15 +90,15 @@ The application owner can choose to upgrade Package C to a version higher than 2
9090

9191
#### Cousin dependencies
9292

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:
9494

9595
![Resolving cousin dependencies using the lower version that satisfies all constraints](media/cousin-dependencies-1.png)
9696

9797
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.
9898

9999
![Resolving cousin dependencies using the lower version that satisfies all constraints at different distances](media/cousin-dependencies-2.png)
100100

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.
102102

103103
![Unresolvable dependencies due to an exact version requirement](media/cousin-dependencies-3.png)
104104

0 commit comments

Comments
 (0)