NuGet Warning NU1604

Missing Package Version

Project dependency 'PackageA' does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results.

Issue

A project dependency doesn't define a version.

This means that restore used the lowest available version. 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.

Solution

Find the PackageReference item that does not define the Version attribute and add it:

For example change from:

<PackageReference Include="PackageA" />

to:

<PackageReference Include="PackageA" Version="9.0.0" />

If the project is using NuGet's Central Package Management (CPM), you need to update the <PackageVersion /> item in Directory.Packages.props and change from:

<PackageVersion Include="PackageA" />

to:

<PackageVersion Include="PackageA" Version="9.0.0" />

If a version is specified in a <PackageVersion /> item and you still receive this warning, verify you've correctly onboarded to central package management.

Note

When using CPM and the file Directory.Packages.props is invalid, NU1604 is raised.

Missing Inclusive Lower Bound

Project dependency 'PackageA' (<= 9.0.0) does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results.

Issue

A project dependency doesn't define a lower bound.

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.

Solution

Update the project's PackageReference Version attribute to include a lower bound. For example change from:

<PackageReference Version="(9.0.0, )" />

to:

<PackageReference Version="[9.0.0, )" />

or

<PackageReference Version="9.0.0" />

which implies a lower bound.

If the project is using NuGet's Central Package Management (CPM), you need to update the <PackageVersion /> item in Directory.Packages.props and change from:

<PackageVersion Include="PackageA" Version="(9.0.0, )" />

to:

<PackageVersion Include="PackageA" Version="9.0.0" />