Bug #57343 Connector/Net 6.3.4 not loaded on Framework.NET 2.0
Submitted: 8 Oct 2010 18:38 Modified: 18 Aug 2011 13:15
Reporter: Duff McKagan Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / NET Severity:S1 (Critical)
Version:6.4.3 OS:Any
Assigned to: CPU Architecture:Any
Tags: connector, NET

[8 Oct 2010 18:38] Duff McKagan
Description:
Hi, i've Windows 7, Visual Studio 2010 and installed MySQL Connector/Net 6.3.4 today.

I've a website project that is developed with Framework NET 2.0, not 3.5 or 4.
I cannot add reference of MySql.Data.dll files into my project. This file is under C:\Program Files (x86)\MySQL\MySQL Connector Net 6.2.4\Assemblies\2.0.
Visual studio says that is developed with a later version of framework, instead of 2.0 (I presume 4.0).

Why i cannot use MySql.Data.dll references? Is it only for 4.0? if YES, why this files is under 2.0 named directory?

Must I use only connector 6.2.4? not the 6.3.4 version? 

How to repeat:
Create a Website Project in Visual Studio 2010.
Set Target Framework of the project to Framework 2.0
Click AddReference.
Browse into MySQl installation directory.
Find and add MySQL.Data.dll
Error appear that say to use a later version of framework

Suggested fix:
Change reference to 4.0 into 2.0
[22 Oct 2010 20:26] Reggie Burnett
I was unable to reproduce this with the latest release of 6.3 (6.3.5).  I was able to add a reference to mysql.data into a website project that was using .net 2.0
[23 Oct 2010 10:44] Duff McKagan
Errore dependencies

Attachment: mysql.jpg (image/jpeg, text), 58.94 KiB.

[23 Oct 2010 10:46] Duff McKagan
I've tried with 6.3.5 version and the problem persists.
The error is in the attached files. You can see it here.
I've created a 2.0 website and added 2.0 mysql.data.dll.
The error persist.
Why?
[5 Jan 2011 23:55] Duff McKagan
I've download the 6.3.6 version and error persists.
Why?!
[24 Mar 2011 9:51] Pedro Cuba
I am having a similar issue.
The difference is that I can actually add the reference to mysql.data.dll in the visual studio project, the problem occurs if I reference any of the mysql classes in my code and try to compile it.
Then I will get lots of warnings regarding indirect dependencies of .net 4.0 assemblies, like the one below:

The primary reference "C:\<assembly>.dll" could not be resolved because it has an indirect dependency on the framework assembly "System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which could not be resolved in the currently targeted framework. ".NETFramework,Version=v3.5". To resolve this problem, either remove the reference "C:\<assembly>.dll" or retarget your application to a framework version which contains "System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089".

This happens whether I get the mysql.data.dll from the "v2" contained in the "no-install" version of the connector or from the "v2.0" folder created by the connector's .msi installer.
[2 Aug 2011 8:24] V�clav Sedl�ček
Hi i have simalar error on version 6.4.3 of connector.
I use assambly v2.0 in project .net framework 3.5. When i referenced this project, then i can't use it, becouse The type or namespace name 'some namespace' could not be found (are you missing a using directive or an assembly reference?)	'some path'

I mean very interested warning is 
The primary reference "xxx" could not be resolved because it has an indirect dependency on the .NET Framework assembly "System.Data.OracleClient, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which has a higher version "4.0.0.0" than the version "2.0.0.0" in the current target framework.

Why assambly of .net Connector for .net framework 2.0 use System.Data.OracleClient, Version=4.0.0.0?
[18 Aug 2011 13:09] Duff McKagan
Problem persist with 6.4.3 version of Connector.NET
Why this problem?
[18 Aug 2011 13:14] Duff McKagan
Ok, I founded the problem. I've downloaded sorucecode of 6.4.3 versione of Connector.NET and investigated MySql.Data referencies and i find that all Framework.NET referencies is 4.0 and not 2.0 (System, System.Data, System.Design, System.Drawing...ect). Is this the solution?
[18 Aug 2011 13:15] Duff McKagan
Ok, I founded the problem. I've downloaded sorucecode of 6.4.3 versione of Connector.NET and investigated MySql.Data referencies and i find that all Framework.NET referencies is 4.0 and not 2.0 (System, System.Data, System.Design, System.Drawing...ect). Is this the solution?