问题
I am trying to set up Entity Framework Core, with a Pomelo provider, in a .NET Framework (4.6.2) project. At runtime I get an error message
The Entity Framework provider type 'Pomelo.EntityFrameworkCore.MySql, Pomelo.EntityFrameworkCore.MySql' registered in the application config file for the ADO.NET provider with invariant name 'MySqlConnector' could not be loaded.
I am just guessing at the "invariantName" to use. According to Microsoft documentation,
invariantName identifies the core ADO.NET provider that this EF provider targets
I am also uncertain what class within the DLL is the actual data provider.
Here is configuration in Web.config at the moment:
<entityFramework>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="MySqlConnector" type="Pomelo.EntityFrameworkCore.MySql, Pomelo.EntityFrameworkCore.MySql" />
</providers>
I've been unable to find documentation for setup in XML config files among the Pomelo pages. Any help would be appreciated.
来源:https://stackoverflow.com/questions/57614123/how-to-configure-pomelo-entityframeworkcore-mysql-in-xml-configuration