Bug #71345 Could not load file or assembly 'mysql.data,' version=6.7.4.0
Submitted: 11 Jan 2014 14:33 Modified: 24 Oct 2014 15:16
Reporter: K Kamau Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Visual Studio Integration Severity:S1 (Critical)
Version:5.6.15.0 OS:Windows
Assigned to: Assigned Account CPU Architecture:Any

[11 Jan 2014 14:33] K Kamau
Description:
I know that this problem has been encountered by many users here on SO but I cannot seem to find a permanent solution.

I keep encountering the error "could not load file or assembly 'mysql.data,' version=6.7.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d".

I am using Visual Studio 2012 Version 11.0.61030.00 Update 4. I have installed MySQL version 5.6.15.0 for Visual Studio. After installation, I notice that the machine.config file for both the 32 and 64 bit entries show Version=6.6.5.0 even though I have never installed a MySQL of that version.

I then check the project references for MySql.Data and MySql.Data.Entity and they are the correct version, i.e. 6.7.4.0 and copy local property set to true.

I even copy this to my App.config file:

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

My application .NET 4.5 using entity framework 5 will run fine until I shut down my computer. If I work on my machine for 4 days without switching it off no problem. After I shut down and restart my machine, the error comes up. I then try to manually change the machine.config settings to the version 6.7.4.0 but to no avail. I try to change the project configuration settings from any CPU to x86 but no solution.

When I encounter this, the only way I get to fix this is to uninstall MySQl and reinstall it again.

Is there a permanent solution to this problem? I am using Windows 7 Ultimate 64 bit.

How to repeat:
1. Have a machine running Win 7 64 bit and Visual Studio 2012.
2. Download and install MySql Version 5.6.15.0 found here: http://dev.mysql.com/downloads/installer/
3. Check the machine.config files MySql.Data versions.
4. Build a program in VS 2012 using Entity Framework 5 and MySql. 
5. Shut down machine and restart. Check if the project will compile without throwing the error.
[24 Sep 2014 15:16] Gabriela Martinez Sanchez
Hi K Kamau,

Have tried to use a newer version?

This bug is resolved in the newest version of the MySQL for Visual Studio product. You can download the 1.2.3 version from 

http://dev.mysql.com/downloads/windows/visualstudio/

You need to install it along with the MySQL Connector/Net
http://dev.mysql.com/downloads/connector/net/

using the 6.7.x or the 6.8 or 6.9.x

I would strongly recommend you to use the 6.9. version.

Please try it and let us know if this worked for you.

Thanks in advance for your feedback.
[25 Oct 2014 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".