NU1608 ErrorProblem in Visual Studio

asp.net-core c# entity-framework-core nuget

Question

I'm Making an Rest APi and i'm traying to install

install-package Microsoft.EntityFrameworkCore.SqlServer

in the Package Manager. Unfortunately this gives an error

NU1608: Detected package version outside of dependency constraint: Microsoft.AspNetCore.App 2.1.1 requires Microsoft.EntityFrameworkCore.SqlServer (>= 2.1.1 && < 2.2.0) but version Microsoft.EntityFrameworkCore.SqlServer 2.2.0 was resolved.

I already tried to search for a solution of this problem but nothing helped. I installed lower version of Microsoft.EntityFrameworkCore.SqlServer in the package manager but the error keeps appearing. Anyone Can help me please?

1
1
1/3/2019 4:21:59 PM

Accepted Answer

NuGet in UWP apps follows the simpler approach where only the explicit package references are shown in the Installed list, hiding indirect references. However, this can be problematic because you can lose control over how dependencies are resolved.

To fix this problem

  1. remove Microsoft.EntityFrameworkCore.SqlServer

  2. remove Microsoft.AspNetCore.App (if you can)

  3. add an explicit reference to Microsoft.EntityFrameworkCore.SqlServer 2.1.4 then add a reference to

  4. add back in Microsoft.AspNetCore.App.

I had the same problem with log4net not using later packages and dragging everything down.

1
1/3/2019 4:19:56 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow