Skip to content

Commit e813422

Browse files
authored
Update NU1604.md (#3350)
1 parent 2540fb2 commit e813422

File tree

1 file changed

+49
-1
lines changed

1 file changed

+49
-1
lines changed

docs/reference/errors-and-warnings/NU1604.md

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,51 @@ f1_keywords:
1212

1313
# NuGet Warning NU1604
1414

15+
## Missing Package Version
16+
17+
> Project dependency 'PackageA' does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results.
18+
19+
### Issue
20+
21+
A project dependency doesn't define a version.
22+
23+
This means that restore used the lowest available version.
24+
Each restore will float downwards trying to find a lower version that can be used.
25+
This means that restore goes online to check all sources each time instead of using the packages that already exist in the user package folder.
26+
27+
### Solution
28+
29+
Find the `PackageReference` item that does not define the `Version` attribute and add it:
30+
31+
For example change from:
32+
33+
> `<PackageReference Include="PackageA" />`
34+
35+
to:
36+
37+
> `<PackageReference Include="PackageA" Version="9.0.0" />`
38+
39+
If the project is using [NuGet's Central Package Management (CPM)](../../consume-packages/Central-Package-Management.md), you need to update the `<PackageVersion />` item in `Directory.Packages.props` and change from:
40+
41+
> `<PackageVersion Include="PackageA" />`
42+
43+
to:
44+
> `<PackageVersion Include="PackageA" Version="9.0.0" />`
45+
46+
If a version is specified in a `<PackageVersion />` item and you still receive this warning, verify you've correctly [onboarded to central package management](../../consume-packages/Central-Package-Management.md#enabling-central-package-management).
47+
48+
> [!Note]
49+
> When using CPM and the file `Directory.Packages.props` is invalid, NU1604 is raised.
50+
51+
## Missing Inclusive Lower Bound
52+
1553
> Project dependency 'PackageA' (&lt;= 9.0.0) does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results.
1654
1755
### Issue
18-
A project dependency doesn't define a lower bound.<br/><br/>This means that restore did not find the *best match*. Each restore will float downwards trying to find a lower version that can be used. This means that restore goes online to check all sources each time instead of using the packages that already exist in the user package folder.
56+
A project dependency doesn't define a lower bound.
57+
58+
This means that restore did not find the *best match*. Each restore will float downwards trying to find a lower version that can be used.
59+
This means that restore goes online to check all sources each time instead of using the packages that already exist in the user package folder.
1960

2061
### Solution
2162
Update the project's `PackageReference` `Version` attribute to include a lower bound.
@@ -32,3 +73,10 @@ or
3273
> `<PackageReference Version="9.0.0" />`
3374
3475
which implies a lower bound.
76+
77+
If the project is using [NuGet's Central Package Management (CPM)](../../consume-packages/Central-Package-Management.md), you need to update the `<PackageVersion />` item in `Directory.Packages.props` and change from:
78+
79+
> `<PackageVersion Include="PackageA" Version="(9.0.0, )" />`
80+
81+
to:
82+
> `<PackageVersion Include="PackageA" Version="9.0.0" />`

0 commit comments

Comments
 (0)