Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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)

like image 382
Jack Tyler Avatar asked Nov 13 '17 13:11

Jack Tyler


1 Answers

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.

like image 88
Gabriel Luci Avatar answered Nov 04 '22 00:11

Gabriel Luci