Jack Tyler
Jack Tyler

Reputation: 529

Entity Framework is being restored via .NetFramework and not Core V2.0 which is my projects framework

When downloading Entity Framework I am getting the error

Package 'EntityFramework 6.2.0' was restored using '.NetFramework, version=v4.6.1' instead of the project target framework ".NETCoreApp, Version=v2.0' This package may not be fully compatible with your project

The reason this is an issue is because when I try to enable migration it gives the following error which I think is linked back to this.

Exception calling "SetData" with "2" argument(s)

Upvotes: 6

Views: 5548

Answers (1)

Gabriel Luci
Gabriel Luci

Reputation: 40958

I ran into this today too. The solution is here: https://blogs.msdn.microsoft.com/dotnet/2017/08/14/announcing-entity-framework-core-2-0/

Specifically:

You can start using EF Core 2.0 today by installing an EF Core 2.0-compatible database provider NuGet package in your applications.

The key is "EF Core 2.0-compatible", which means you have to install one of the Microsoft.EntityFrameworkCore packages from NuGet.

So if you're using SQL Server, you'll install Microsoft.EntityFrameworkCore.SqlServer.

Upvotes: 6

Related Questions