Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System.Data.Entity is not available

I have added .Net Standard Library 2.0 and I have installed EntityFramework 6.4.0 via NuGet Package manager, But unable to inherit DbContext in my class because System.Data.Entity is not available. What should I do to use DbContext?

like image 754
Sivakumar Avatar asked Oct 17 '25 16:10

Sivakumar


1 Answers

As @magicandre1981 said, you need to upgrade to .NET Standard 2.1.

I hate all these hidden version incompatibilities! We had EntityFramework 6.2 running in a .NET Standard 2.0 project. Updating EF produced no version incompatibility warnings, even though if you look closely from EF 6.3+ it requires .NET Standard 2.1.

Edit: And the calling project is Framework 4.8, which does NOT support .NET Standard 2.1. So it's back to EF 6.2 and .NET Standard 2.0 for me.

like image 65
Neil Laslett Avatar answered Oct 20 '25 08:10

Neil Laslett