MySQL with Entity Framework - what am I doing wrong?

前端 未结 5 401
醉酒成梦
醉酒成梦 2021-01-12 08:49

I am completely new to Entity Framework and even ADO.NET in general (don\'t typically do much work with databases).

  1. I downloaded and installed MySQL Connector/
5条回答
  •  南方客
    南方客 (楼主)
    2021-01-12 09:43

    In the MySqlClientFactory-> MySqlDbProviderServicesInstance property. It reference the ass:MySql.Data.Entity use the code

    string str = Assembly.GetExecutingAssembly().FullName.Replace("MySql.Data", "MySql.Data.Entity");

    But in the MySql Client 6.3.5 the MySqlData's version is 6.3.5, and MySql.Data.Entity's version is 6.3.4(in \Program Files\MySQL\MySQL Connector Net 6.3.5\Assemblies\v2.0).so it can't load it successfully.

    In the folder(\Program Files\MySQL\MySQL Connector Net 6.3.5\Assemblies\v4.0) ,the MySql.Data.Entity's version is 6.3.5,so itcan load successed.

    So the one way is change the target to .NET 4.0,and another is roll the MySql.Data back to 6.3.2/6.1.2 .

提交回复
热议问题