NuGet Warning NU1605

Example 1

Detected package downgrade: 'PackageB' from 4.0.0 to 3.5.0. Reference the package directly from the project to select a different version.
'PackageA' 3.5.0 -> 'PackageB' 3.5.0
'PackageC' 4.0.0 -> 'PackageD' 4.0.0 -> 'PackageB' 4.0.0

Issue

A dependency package specified a version constraint on a higher version of a package than restore ultimately resolved. That is because of the nearest-wins rule - when resolving packages, the version of the nearer package in the graph will override that of the distant package with the same ID.

Solution

To the project exhibiting the restore error, add a package reference to the higher version of the package.

In the example above, you would add a package reference to Package B version 4.0.0:

  'PackageA' 3.5.0 -> 'PackageB' 3.5.0
'PackageC' 4.0.0 -> 'PackageD' 4.0.0 -> 'PackageB' 4.0.0
'PackageB' 4.0.0

Since, nearest-wins, the direct package reference to PackageB v4.0.0, will take precedence over the transitive reference to PackageB v3.5.0.

Example 2

Detected package downgrade: System.IO.FileSystem.Primitives from 4.3.0 to 4.0.1. Reference the package directly from the project to select a different version.
Project -> System.IO.FileSystem 4.0.1 -> runtime.win.System.IO.FileSystem 4.3.0 -> System.IO.FileSystem.Primitives (>= 4.3.0)
Project -> System.IO.FileSystem 4.0.1 -> System.IO.FileSystem.Primitives (>= 4.0.1)

Issue

Certain combinations of packages which shipped with .NET Core 1.0 and 1.1 are not compatible with each other when they are referenced together in a .NET Core 3.0 or higher project, and a RuntimeIdentifier is specified. The problematic packages generally start with System. or Microsoft., and have version numbers between 4.0.0 and 4.3.1. In this case, the downgrade message will have a package starting with runtime. in the dependency chain.

Solution

To work around this issue, add the following PackageReference:

<PackageReference Include="Microsoft.NETCore.Targets" Version="3.0.0" PrivateAssets="all" />

Example 3

Detected package downgrade: Microsoft.NETCore.App from 2.1.8 to 2.1.0. Reference the package directly from the project to select a different version.
test -> mvc -> Microsoft.NETCore.App (>= 2.1.8)
test -> Microsoft.NETCore.App (>= 2.1.0)

Issue

The mvc project specified a version constraint on a higher version of a package than restore ultimately resolved. That is because of the nearest-wins rule - when resolving packages, the version of the nearer package in the graph will override that of the distant package with the same ID.

Solution

This specific error (with Microsoft.NETCore.App package) is improved by moving your .NET Core SDK to 2.2.100 or later. Microsoft.NETCore.App is an auto-referenced package that the .NET Core SDK before version 3.0.100 chooses to bring in automatically. Also see Self-contained deployment runtime roll forward.