dotnet/efcore

Error NU1605 Detected package downgrade: Microsoft.NETCore.App from 2.0.3 to 2.0.0

Closed this issue · 5 comments

I upgraded VS2017 to 15.4.5, verified that .NETCore SDK 2.0.3 is properly installed and upgraded all of the NuGet packages in my multi-project solution to the latest versions. The solution is configured to run all ASP.NET Core Web API projects in Docker/Linux. All of the updates went smoothly except for Microsoft.EntityFrameworkCore.Tools.DotNet 2.0.1. It causes the build to break with this message in various places:

Error NU1605 Detected package downgrade: Microsoft.NETCore.App from 2.0.3 to 2.0.0. Reference the package directly from the project to select a different version.
MyProject.EF -> Microsoft.EntityFrameworkCore.Tools.DotNet 2.0.1 -> Microsoft.NETCore.App (>= 2.0.3)
MyProject.EF -> Microsoft.NETCore.App (>= 2.0.0)

Removing this packages gets rid of the errors. Adding it back makes the errors re-appear.

Any help would be appreciated,
Mike
efcoretoolserror

It looks like you've included Microsoft.EntityFrameworkCore.Tools.DotNet as a PackageReference. It should only be included as a DotNetCliToolReference.

<ItemGroup>
  <!-- Remove this -->
  <PackageReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet"
                    Version="2.0.1" />

  <!-- Keep this -->
  <DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet"
                          Version="2.0.1" />
</ItemGroup>

You are correct. I'm not sure how it got into my project file as a PackageReference, but that was it. Thank you.

There is some way to tell dotnet to add cli tools references in the proper section?

Thanks @MikeYeager for the question and Thanks @bricelam for the answer it was very helpfull