C
C#2y 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
Angius2y ago
An issue with EF maybe? Can't you use EF Core?
MeHow
MeHow2y ago
I'm using EF Core 😄
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Angius
Angius2y 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 User2y ago
Message Not Public
Sign In & Join Server To View
MeHow
MeHow2y ago
It did not work on EF Core 3.1 either
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
MeHow
MeHow2y ago
Fine, so: - These are the versions of EFCore I use
MeHow
MeHow2y ago
- This is my Context class:
MeHow
MeHow2y ago
- This is how I use it:
MeHow
MeHow2y 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
MeHow2y ago
As you can see it uses the 1.0.19269.1 version of this package, which seems to support .netCore 2.1.
MeHow
MeHow2y ago
I updated the package to 3.1.0 and the exception still remains:
MeHow
MeHow2y ago
So, I've upgraded the .NET version of my project to 6.0 and the problem still remains on updated packages
MeHow
MeHow2y ago
MeHow
MeHow2y ago
I downgraded packages to the 6.0.0 and the problem still remains:
MeHow
MeHow2y ago
Ok, fuck it, i switched to postgresql and it works