joseluisrod
joseluisrod

Reputation: 82

can not upgrade from EF Core 1.1.2 to version 2.0.0

All, I recently started working on a project that uses EF Core 1.1.2. I saw where 2.0 was released because I started getting errors when I tried to add EF core to a project. I couldn't update the existing project, I created a brand new console project. Set the .Net framework to 4.6.1 and still had no luck. I always get the following message. Has anyone ran into this issue? thanks in advance

Install-Package : Could not install package 'Microsoft.EntityFrameworkCore.SqlServer 2.0.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.6.1', but the package does not contain any assembly references or content files that are compatible with that framework.

Upvotes: 1

Views: 1326

Answers (3)

Ivan Stoev
Ivan Stoev

Reputation: 205799

EF Core 2.0 release has been officially announced and the documentation is (partially) updated.

Of course it's not NET Core only. But the actual prerequisites for targeting Full .NET Framework are as follows:

(1) Project targeting .NET Framework 4.6.1 and above.

(2) Visual Studio 2017 with (important!) 15.3.0 update (also just released) installed

Before updating the VS I was getting the same error. After updating the error is gone and EF 2.0 package is successfully installed.

Upvotes: 6

Scrobi
Scrobi

Reputation: 1200

EF Core 1.1.2 had a dependency on .NETStandard 1.3 or .NETFramework 4.5.1. So as you were targeting .NetFramework 4.5.2 everything is hunky dory.

EF Core 2.0 has a dependency on .NETStandard 2.0. This is not compatible with the .NETFramework, everything is far from hunky dory.

According to the source below you can get .NetFramework support with 2.0 tooling, which is in preview:

The alternative would be to migrate your application so it doesn't use the .NetFramework but only targets .NETStandard libraries.

Sources

Good luck.

Upvotes: 3

Kinexus
Kinexus

Reputation: 12904

EntityFramework Core 2.0.0 is not compatible with a Target framework other than Core 2.0.0. You will need to ensure your project is targetting this and install any dependancies.

It will NOT work with the (standard) .NET framework versions, it is a 'Core' specific release.

Upvotes: 1

Related Questions