Bug #53686 Net/Connector 6.3.1 only working on Framework 4, not 3.5
Submitted: 16 May 2010 22:32 Modified: 21 Jul 2010 18:21
Reporter: Anders V Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:6.3.1 OS:Windows (7)
Assigned to: CPU Architecture:Any
Tags: .NET Framework 4, 6.3.1

[16 May 2010 22:32] Anders V
Description:
Hi,

I can only get the Connector/NET 6.3.1 (alpha) to work for .NET Framework 4. If I change to .NET Framework 3.5 and try to add a reference to MySql.Data.dll, I get a message saying that "MySQl.Data.dll or one of its dependencies requires a later version of the .NET Framework than the one specified in the project.  

According to the table on this site: http://dev.mysql.com/doc/refman/5.1/en/connector-net-versions.html - there should be compatibility from .NET Framework 2.x and up. 

I am using Visual Studio 2010 Ultimate (on Windows 7 Ultimate). I am deploying on Windows Azure, and therefore I cannot use .NET Framework 4 (Azure is not ready for this). If I change provider to Connector/NET 6.2.3, then I cannot use it in Visual Studio 2010. 

Any work-around on this?

How to repeat:
To repeat: Use Visual Studio 2010, create a project with .NET Framework 3.5, add MySql.Data.dll as a Reference - and the message pops up. Ignoring the message may work, and it is possible (in my case) to run it locally, but once deployed the provider fails.
[16 May 2010 22:48] Anders V
The error when running it deployed is that..."The specified store provider cannot be found in the configuration, or is not valid."
[17 May 2010 23:40] Rami Abughazaleh
Hi.

I am also experiencing the same behavior.

Here is a more detailed exception that gets thrown when using an exe that is targeted for .net 4, MySQL Connector Net 6.2.3 installed, and running on Windows 7 Ultimate x64.

Unhandled Exception: System.ArgumentException: The specified store provider 'MySql.Data.MySqlClient' cannot be found in the configuration, or 'MySql.Data.MySqlClient' is not valid. ---> System.ArgumentException: Unable to find the requested .Net Framework Data Provider.  It may not be installed.
   at System.Data.Entity.Design.EntityStoreSchemaGenerator.CreateStoreSchemaConnection(String providerInvariantName, String connectionString)
   --- End of inner exception stack trace ---
   at System.Data.Entity.Design.EntityStoreSchemaGenerator.CreateStoreSchemaConnection(String providerInvariantName, String connectionString)
   at System.Data.Entity.Design.SsdlGenerator.EntityStoreSchemaGeneratorDatabaseSchemaLoader..ctor(String providerInvariantName, String connectionString)
   at System.Data.Entity.Design.EntityStoreSchemaGenerator..ctor(String providerInvariantName, String connectionString, String namespaceName)
[18 May 2010 0:08] Rami Abughazaleh
You can manually work around this issue for MySQL Connector Net 6.2.3 by adding the following in 
"C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config"

configuration/system.dataDbProviderFactories

<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.2.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
[20 May 2010 19:35] Anders V
I tried the hack with the machine.config and version 6.2.3, but that does not change anything. I still don't have it as an option in VS2010, and it cannot find the MySql provider.
The only way I can get it working is with the 6.3.1 provider, - but it will only work for .NET Framework 4.

Any ideas?
[21 May 2010 4:35] Rami Abughazaleh
If you are on a 64-bit machine, also try adding the MySql DBProviderFactory to
"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config"
(notice the Framework64).

The MySql setup installer will modify the registry to support Visual Studio integration.

I noticed that Visual Studio 2010 integration will most likely be supported in the next mysql connector/net release (6.3.2) because new setup installer instructions were just added today:
http://bazaar.launchpad.net/~mysql-clr-team/connectornet/trunk/revision/871

But please don't take my word for it.  :)

You can either
1. decipher the setup installer instructions and manually perform the registry changes yourself (make sure you have a backup and be careful when editing the registry)
2. build the sources from svn and you will have a 6.3.2 "preview" setup installer.  (I have not done this before, and this is "bleeding edge" so this will take some time - be very patient, cautious \ use a test machine)
3. manually work-around the un-supported integration features with visual studio 2010
4. wait for the 6.3.2 release and try again

I would recommend 3 and\or 4.

Good luck! :)
[28 May 2010 9:31] Bogdan Degtyariov
When I try to install Connector/NET 6.3.1 the installation finishes with the note (FW 4.0 is installed with VS2010 Express):

MySQL Connector NET 6.3.1 Setup Wizard ended prematurely.

No error details are given. The Application log in Computer Management shows the following record:

Windows Installer installed the product. Product Name: MySQL Connector Net 6.3.1. Product Version: 6.3.1. Product Language: 1033. Installation success or error status: 1603.
[20 Jul 2010 14:31] Vladislav Vaintroub
Andres, you can workaround the missing provider by registering it in your app.config, or web.config, instead of registering it machine-wide.

<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" />
</DbProviderFactories>
</system.data> 

Also, have MySql.Data.dll and MySql.Data.Entity.dll in the bin folder.

The installation problems you described are being addressed currently.
[21 Jul 2010 18:21] Vladislav Vaintroub
This seems to be duplicate of bug#53975 et al. Installer and provider registration for different versions of .NET framework got fixed recently and the fix will be available in 6.3.3

Please reopen the bug if upcoming 6.3.3 will not work for your environment.