DLL Hell - my application gives an error message if version 6.9.3.0 or 6.8.3.0 from MySql.Data.dll is missing

Context of problems

I wrote a C # application that uses MySqlConnector. I added MySql.Data.dll (version 6.9.3.0) to References - all this works on my PC (running Windows 7). However, since the last builds, when I try to run the application on another PC (running Windows XP), it throws an exception at startup.

I added an UnhandledExceptionEventHandler that shows the error Could not load file or assembly 'MySql.Data, Version 6.8.3.0. (...etc...)' or one of its dependencies. The located assembly manifest description does not match the assembly reference. File name: 'MySql.Data, Version=6.8.3.0, (...etc...) Could not load file or assembly 'MySql.Data, Version 6.8.3.0. (...etc...)' or one of its dependencies. The located assembly manifest description does not match the assembly reference. File name: 'MySql.Data, Version=6.8.3.0, (...etc...) Could not load file or assembly 'MySql.Data, Version 6.8.3.0. (...etc...)' or one of its dependencies. The located assembly manifest description does not match the assembly reference. File name: 'MySql.Data, Version=6.8.3.0, (...etc...) .

Obviously, he is looking for version 6.8.3.0, but only looking for version 6.9.3.0 in the links, but I want to know why she is looking for this version, when it works correctly with previous builds and how I can specify which version of MySql to look for.

I know that I can just add another link to an earlier version of .dll , but I want to understand why this is happening.

Steps taken to try to diagnose the problem

  • I checked the References project after viewing this issue for a stack overflow and confirmed that a link to MySql.Data.dll was added to the project, with its version ( 6.9.3.0 ).

  • I looked for the results associated with the Exception error message, and found this article on stack overflow , describing its cause (which I knew about, but it confirms this)

  • A colleague asked me to confirm that the SpecificVersion property of the MySql.Data link MySql.Data set to False (it is).

  • I tried to add the assembly binding to the config, as suggested in the answer below - this does not help, the same error is caused.

  • Replace MySqlData.dll on the other PC with version 6.8.3.0 as a “dirty fix” to find out what happened. Now it gives the same error as before, but 6.9.3.0 missing.

  • I asked a colleague to run the application on his computer (Windows 7) - the error was not generated, and it worked as expected.

  • I tried using the Dependency Walker utility in .exe as a comment, but only showed that the following .dlls are missing - IESHIMS.DLL (on both PCs), WER.DLL (on XP PC) and GPSVC.DLL (on my PC). There MySql.Data.dll nothing in MySql.Data.dll . (Although I have since found out that this is not a useful tool in this case - see this question .)

  • On a whim, I decided to change the SpecificVersion property MySql.Data Link to True - this fixes the problem.


Additional Information

My app.config file is

 <?xml version="1.0"?> <configuration> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0,Profile=Client"/> </startup> </configuration> 
+7
c # mysql
source share
1 answer

Changing the SpecificVersion property of the MySql.Data link to the True link fixes the problem.

My hypothesis is that the application was somehow looking for version 6.8.3.0. at the same time 6.8.3.0. and 6.9.3.0. at the same time, however, by specifying a specific version, it does not “confuse itself” and is just suitable for 6.9.3.0. which is.

+4
source share

All Articles