5

I have just installed the latest version of MySQL.Data.EntityFramework Version 8.0.19.

The first time I run the code I got the following error:

The latest nuget package (MySql.Data 8.0.19) contains an unsigned version of Ubiety.Dns.Core.dll. This results in an exception while loading.

according to: this bug report, I need to install: Ubiety.Dns.Core/ package... so I installed this package. Now I am getting the following exception:

Could not load file or assembly 'MySql.Data.EntityFramework, Version=8.0.19.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies.


As a workaround I tried to install the previous version, MySQL.Data.EntityFramework Version 8.0.18 but I cannot find any previous version: MySql.Data.EntityFramework Nuget.

Anyone knows if the previous versions have been removed?

Hooman Bahreini
  • 14,480
  • 11
  • 70
  • 137

6 Answers6

5

For those who do not want the thousands of redundant warnings that for some reason appears with Ubiety.Dns.Core -- installing an earlier version worked fine for me:

Install-Package Ubiety.Dns.Core -Version 2.4.1
2

check your Web.Config if you have this rows.

     <system.data>
    <DbProviderFactories>
      <remove invariant="MySql.Data.MySqlClient" />
      <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data,      Version=8.0.19.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
    </DbProviderFactories>
  </system.data>

and also added provider:

<provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.EntityFramework, Version=8.0.19.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d">
2

Update:

MySQL.Data 8.0.19 has a dependency on Ubiety.Dns.Core, which is not automatically installed. You need to install Ubiety.Dns.Core separately after installing MySQL.Data 8.0.19

Also note that Oracle has removed all the previous versions of MySQL.Data 8.0.19, see here so if you upgrade to 8.0.19 you cannot go back to 8.0.18... I believe the reason for removing all the previous versions is that they had a bug with multi-host connection string which was fixed in 8.0.19.


Original answer:

In my case, the reason I was getting an error was that I had forgotten to upgrade all of the projects in my solution to MySQL.Data 8.0.19 and some of them were still on 8.0.18.

Hooman Bahreini
  • 14,480
  • 11
  • 70
  • 137
2

wow, amazingly, I am having the exact same issue. What I did to resolve:

  • Update all projects to 8.0.19 of the mysql provider.
  • Re-add the db provider tag to my web.config. I had accidently removed it. That was my fault.
  • Finally, I installed the Ubiety.Dns.Core.

Doing all of this resolved my problems.

Wallace B. McClure
  • 1,165
  • 1
  • 15
  • 31
2

Currently I've resorted to using 8.0.18 until a fix is released, since installing Ubiety.Dns.Core in my projects results in thousands of warnings across my source code.

Install-Package MySql.Data -version 8.0.18
foamy
  • 698
  • 1
  • 8
  • 20
0

for me removing following part of code was the fix

    <system.data>
        <DbProviderFactories>
           <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=8.0.19.0, Culture=neutral, PublicKeyToken=xxxx" />
        </DbProviderFactories>
    </system.data>
Gambitier
  • 504
  • 6
  • 18