C
C#•3y ago
MeHow

Microsoft.Data.SqlClient is not supported on this platform - .net6.0+ EF 6.0.0

Hi. I'm trying to setup the Entity Framework Core 5.0.0 for the SqlServer in .netCore3.1 class library project. I am facing this problem, which I can't figure out. Does anyone know any possible solution? My OS is Windows 11
17 Replies
Angius
Angius•3y ago
An issue with EF maybe? Can't you use EF Core?
MeHow
MeHowOP•3y ago
I'm using EF Core 😄
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Angius
Angius•3y ago
Huh, true, that "platform" might be referring to the framework version I assumed it means the OS or the CPU architecture
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
MeHow
MeHowOP•3y ago
It did not work on EF Core 3.1 either
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
MeHow
MeHowOP•3y ago
Fine, so: - These are the versions of EFCore I use
MeHow
MeHowOP•3y ago
- This is my Context class:
MeHow
MeHowOP•3y ago
- This is how I use it:
MeHow
MeHowOP•3y ago
- The exception is being thrown in this namespace: Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal, so I'm assuming it's the EntityFrameworkCore.SqlServer package. It uses the Microsoft.Data.SqlClient package.
MeHow
MeHowOP•3y ago
As you can see it uses the 1.0.19269.1 version of this package, which seems to support .netCore 2.1.
MeHow
MeHowOP•3y ago
I updated the package to 3.1.0 and the exception still remains:
MeHow
MeHowOP•3y ago
So, I've upgraded the .NET version of my project to 6.0 and the problem still remains on updated packages
MeHow
MeHowOP•3y ago
MeHow
MeHowOP•3y ago
I downgraded packages to the 6.0.0 and the problem still remains:
MeHow
MeHowOP•3y ago
Ok, fuck it, i switched to postgresql and it works

Did you find this page helpful?