Could not load file or assembly ‘MySql.Data, Version=5.1.5.0, …” [Solved]

C

Error:
If you are accessing MySql from your ASP.NET code and getting this error after uploading code to Server:

Parser Error Message: Could not load file or assembly ‘MySql.Data, Version=5.1.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d’ or one of its dependencies. The system cannot find the file specified.

Solution:
Make sure /bin/MySql.Data.dll exists on root folder.

I was accessing the code from url http://demos.nanostuffs.com/SomeFolder/Default.aspx

So MySql.Data.dll should be present at location:
http://demos.nanostuffs.com/bin/MySql.Data.dll

Even if you place the .dll in /SomeFolder/bin/, it does not work.

About the author

Nishant Bamb
By Nishant Bamb

Category