While performing a dotnet restore
on a .NET Core project (targeting .netcoreapp2.0.), I get the following warning:
warning NU1604: Project dependency System.Net.NameResolution does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results.
Here is the relevant line from the project file:
<PackageReference Include="System.Net.NameResolution" Verison="4.3.0" />
(If you are wondering, I have included that reference to avoid a warning NU1605: Detected package downgrade.)
How does one "include a lower bound in the dependency version to ensure consistent restore results"?
In order to indicate a minimum version for your package references you have to set the Version property of your reference to a range that contains an inclusive lower bound. As @Carter pointed out, Microsoft provides a nice documentation about the format of that property.
If you don't specify an inclusive lower bound for your references, each restore will try to find a lower version of the package that can be used. More information about that warning can be found on the nuget errors and warnings reference page
The only problem with your reference seems to be that you have a typo (Verison instead of Version). So the line should be
<PackageReference Include="System.Net.NameResolution" Version="4.3.0" />
With this line, you indicate that the project requires the version 4.3.0 or above of the package System.Net.NameResolution, hence the inclusive lower bound on 4.3.0.
I think the key there is to not include the last digit on your version. Then it will set the lowerbound as 4.3.0 by default.
<PackageReference Include="System.Net.NameResolution" Version="4.3" />
Right click "Packages" -> Manage NuGet Packages -> Update
Update all broken packages, if that is not available remove them and add them again.
Managing the package version is quite important. you must mention the version or have a floated version specified.
<PackageReference Include="System.Net.NameResolution" Version="4.3" />
or
<PackageReference Include="System.Net.NameResolution" Version="4.*" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With