Answered by:
Including and using the MySql.Data.dll on your web host server

Question
-
User887984496 posted
I'm having problems including and linking the MySql.Data.dll on my web host server.
On my Visual Studios IDE it's not a problem. But I'm working directly from my files on my web hosting service.
I've read that using the Web.Config file you can reference the DLL assembly by adding it as such
<configuration>
<system.web>
<customErrors mode="Off"/>
<compilation>
<assemblies>
<add assembly="MySql.Data, Version=6.6.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</assemblies>
</compilation>
</system.web></configuration>
I've also tried uploading the MySq.Data.dll onto my web host root directory with my Default.aspx file but after when I go to my sites URL it gives me this error:
Parser Error Message: Could not load file or assembly 'MySql.Data, Version=6.6.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The system cannot find the file specified.
Anyone know a useful link or site that discusses ways around this?
Thanks.
Monday, March 11, 2013 7:32 PM
Answers
-
User-166373564 posted
Hi,
Could not load file or assembly 'MySql.Data' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loadedFirst you should check whether give a reference to MySql.Data.dll properly in your project. As the error messages show, you should also check whether whether you have appropriate MySql.Data.dll.
hope it helps you,
With regards
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, March 21, 2013 1:48 AM -
User13850534 posted
You need to make sure your host server has support over this mysql connector.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Friday, March 22, 2013 10:48 PM
All replies
-
User1747761241 posted
The dll goes in the bin folder. In fact all dlls for your website go in the bin folder. If you don't have a bin folder create it.
I made a seperate project for mysql access so it would be more dotnet like then I access the mysql project methods and procedures to get data from mysql. The complete code for this is in the above blog link.
Wednesday, March 13, 2013 10:12 AM -
User887984496 posted
Hello,
I just tried that and now I get this error:
Could not load file or assembly 'MySql.Data' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded
I'm going to tug on this string now and see what I can find out to resolve it. At least now I know the web host server can see it. I imagine I need an older version of the dll.
I appreciate your help.
Monday, March 18, 2013 8:44 PM -
User-166373564 posted
Hi,
Could not load file or assembly 'MySql.Data' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loadedFirst you should check whether give a reference to MySql.Data.dll properly in your project. As the error messages show, you should also check whether whether you have appropriate MySql.Data.dll.
hope it helps you,
With regards
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, March 21, 2013 1:48 AM -
User13850534 posted
You need to make sure your host server has support over this mysql connector.
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Friday, March 22, 2013 10:48 PM -
User887984496 posted
I have a feeling that its the web host that cannot support it. The hosting service runs a Windows 2003 Server edition.
And I believe I downloaded the latest MySql.Data.Dll which was developed on a platform that Windows 2003 Server doesn't support.
My next trick is to see if I can find an older version of that dll on the MySql website.
Friday, March 29, 2013 3:21 PM -
User887984496 posted
Yes I believe I'm using a newer version of the dll. I need to find an older version of it off the MySql website.
Friday, March 29, 2013 3:22 PM -
User-1659306303 posted
Hello, I have this same problem.
I also got an error identified on line:
<add assembly="MySql.Data, Version=6.6.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
And when I copied the dlls into the bin directory I got the same error as you:
Could not load file or assembly 'MySql.Data' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded
What all did you do to fix it (if it's fixed)?
In phpMyAdmin it says I have Software version 5.5.15 of mysql on the web server. I proceeded to try and find 5.5.15 to download to my pc so I could reference it in VS 2008 and make any adjustments. Using http://www.herongyang.com/MySQL/MySQL-5-5-Installation.html I followed the directions for 5.5.15 and ended up with 5.5.32 which I assume is the 32 bit version. According to the directions I successfully installed everything but there are no dlls in the mysql\bin folder and I couldn't find the MySql.Data.Dll for this older version.
My web host provided this link: http://www.mindscapehq.com/forums/thread/689146 which includes:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" />
<bindingRedirect oldVersion="6.3.6.0" newVersion="6.6.5.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
Which I assume I should include IF I can get the newer dlls to get referenced from my bin folder but as mentioned I get the "Could not load file or assembly 'MySql.Data' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded" error.
Tuesday, July 9, 2013 10:17 AM