C#
C#

help

Root Question Message

MeHow
MeHow11/13/2022
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
Angius
Angius11/13/2022
An issue with EF maybe? Can't you use EF Core?
MeHow
MeHow11/13/2022
I'm using EF Core 😄
Message Not Public

Sign In and Join Server To See

11/13/2022
Message Not Public

Sign In and Join Server To See

11/13/2022
Angius
Angius11/13/2022
Huh, true, that "platform" might be referring to the framework version
Angius
Angius11/13/2022
I assumed it means the OS or the CPU architecture
Message Not Public

Sign In and Join Server To See

11/13/2022
MeHow
MeHow11/13/2022
It did not work on EF Core 3.1 either
Message Not Public

Sign In and Join Server To See

11/13/2022
MeHow
MeHow11/13/2022
Fine, so:
- These are the versions of EFCore I use
MeHow
MeHow11/13/2022
- This is my Context class:
MeHow
MeHow11/13/2022
- This is how I use it:
MeHow
MeHow11/13/2022
- 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
MeHow11/13/2022
As you can see it uses the 1.0.19269.1 version of this package, which seems to support .netCore 2.1.
MeHow
MeHow11/13/2022
I updated the package to 3.1.0 and the exception still remains:
MeHow
MeHow11/13/2022
So, I've upgraded the .NET version of my project to 6.0 and the problem still remains on updated packages
MeHow
MeHow11/13/2022
MeHow
MeHow11/13/2022
I downgraded packages to the 6.0.0 and the problem still remains:
MeHow
MeHow11/13/2022
Ok, fuck it, i switched to postgresql and it works
ContactFrequently Asked QuestionsJoin The DiscordBugs & Feature RequestsTerms & Privacy