I'm using Microsoft.EntityFrameworkCore.SqlServer
(3.1) in a .NET Core 3.1 library. This library gets loaded at runtime by an executable .NET Core project by using:
Assembly.LoadFrom('some.dll');
When trying to retrieve data from a DbSet
, I get the following exception:
System.PlatformNotSupportedException: 'Microsoft.Data.SqlClient is not supported on this platform.'
I guess it has something to do with loading the library at runtime, but I don't get why?
I tried various different things, like overriding the Microsoft.Data.SqlClient
library with Version 1.1 or 2.0, but without any success.
The SqlClient provider for the Entity Framework provides mapping information between conceptual model types and SQL Server types.
The Microsoft. Data. SqlClient API details can be found in the . NET API Browser.
SqlClient) Provides a simple way to create and manage the contents of connection strings used by the SqlConnection class.
dotnet/SqlClient. Microsoft. Data. SqlClient provides database connectivity to SQL Server for . NET applications.
I received this message:
System.PlatformNotSupportedException: Microsoft.Data.SqlClient is not supported on this platform.
My solution:
Newtonsoft
namespace, e.g. Newtonsoft.Json and this namespace could not be found after installing Microsoft.Data.SqlClient, then get the Newtonsoft.Json dependency from NuGet.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With