How to configure Pomelo.EntityFrameworkCore.MySql in XML configuration?

被刻印的时光 ゝ 提交于 2019-12-11 06:09:12

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!