Bug #27192 MySql.Data.dll reference hard linking version
Submitted: 15 Mar 2007 23:26 Modified: 23 Mar 2007 11:09
Reporter: Jared S (Silver Quality Contributor) Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:5.0.5 OS:Windows (WinXP)
Assigned to: CPU Architecture:Any
Tags: assembly, include, proj, qc, reference

[15 Mar 2007 23:26] Jared S
Description:
When adding reference to mysql.data.dll, too much information is added.  When such information as token and version is present it hard links that specific assemmbly to the current build of my software and mysql components are not updradable without re-compile of my software.

How to repeat:
1. Create new project
2. Add reference to 5.0.5 dll
-. uninstall 5.0.5
3. gacutil /u mysql.data      
-. install 5.0.6
4. gacutil /i mysql.data.dll  
5. Run your compiled application that utilizes mysql data 5.0.5

RESULT very vague microsoft system.io.filenotfound error 

Suggested fix:
In Application1.vbproj file, Change this..

<Reference Include="MySql.Data, Version=5.0.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL" />

To this..

<Reference Include="MySql.Data" />

So component is upgradeable without requiring software rebuild.  And also that its reference is inline with microsoft componets reference.
[19 Mar 2007 17:54] Reggie Burnett
Jared

What product are you reporting a bug on?  You included a snippet for adding a reference to a Visual Basic app but you are reporting it as a bug in the provider.

Reggie
[19 Mar 2007 21:39] Jared S
If you have no control over what reference information is appended to .vbproj file then I guess I will close this bug off and goto connect.microsoft.com.

Do you agree that an enhancement may be required from Microsoft because Visual Studio is adding to much information in project file?
[23 Mar 2007 11:08] Jared S
Although I removed alot of the reference information I found that 5.0.6 data connecter doesnt work with 5.0.5 compiled VB application.  So I will close bug of.  It would be good if MySql.Data.DLL could be **dynamically** linked.
[23 Mar 2007 11:09] Jared S
..this is either S4 or cant be done.
[23 Mar 2007 14:37] Reggie Burnett
Jared

This can be solved with either an application level config file or a publisher policy file.  Here is an example of including a binding redirect in your config file.

<?xml version="1.0"?>
<configuration>
  <runtime>
    <assemblyBinding
     xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" />
        <bindingRedirect oldVersion="5.0.6.0" newVersion="5.0.7.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

This will allow apps compiled for 5.0.6 to work with 5.0.7 installed.  YOu can also use wildcards for the from version.  I'm considering shipping a publisher policy file that will include this.