How do I reference Entity Framework 6 from . Net Core Class Library?

Asked

Viewed 59 times

0

When installing the Entity Framework by Nuget I got the following error in its reference:

The dependency Entityframework 6.1.3 does not support framework . Netcoreapp, Version=v1.6

How to get around this mistake? If anyone can help, I would be grateful!

1 answer

1

Entityframework 6 is not supported in . NET Core. For . NET Core you need to use Entity Framework Core. You can use EF6 with projects made using VS2017 or .NET Core Tools, but referencing the full framework in . csproj.

<PropertyGroup>
    <TargetFramework>net461</TargetFramework>
</PropertyGroup>
<ItemGroup>
    <PackageReference Include="EntityFramework" Version="6.1.3" />
</ItemGroup>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.