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
![](https://utfs.io/f/19de72a0-8f4c-476b-b7da-cdeab1c4cbaf-1nq2cb.png)
17 Replies
An issue with EF maybe? Can't you use EF Core?
I'm using EF Core 😄
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Huh, true, that "platform" might be referring to the framework version
I assumed it means the OS or the CPU architecture
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
It did not work on EF Core 3.1 either
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Fine, so:
- These are the versions of EFCore I use
![](https://utfs.io/f/5fb3ff56-81da-4f23-bf87-7ee8f38a6c1c-1nq2cb.png)
- This is my Context class:
![](https://utfs.io/f/1bf087f1-07ad-4ef0-896a-97db906abaf7-1nq2cb.png)
- This is how I use it:
![](https://utfs.io/f/fd3c3317-bdf2-4897-85b5-5c9eb6230d3f-1nq2cb.png)
- 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.![](https://utfs.io/f/c28260ae-cfcb-42f7-9e2f-9b5b54708f51-1nq2cb.png)
As you can see it uses the 1.0.19269.1 version of this package, which seems to support .netCore 2.1.
I updated the package to 3.1.0 and the exception still remains:
![](https://utfs.io/f/94497216-273a-4d35-9ec7-1226c29fa7e8-1nq2cb.png)
So, I've upgraded the .NET version of my project to 6.0 and the problem still remains on updated packages
![](https://utfs.io/f/31783aa6-fa80-46ae-b660-8a4a685abb5d-1nq2cb.png)
I downgraded packages to the 6.0.0 and the problem still remains:
![](https://utfs.io/f/a5d875d7-c08c-441f-a39a-7c7118d3a9e7-1nq2cb.png)
Ok, fuck it, i switched to postgresql and it works