After publishing ASP.NET project, MySQL connection no longer works RRS feed

  • Question

  • User-1308001750 posted

    To start, I am a new web developer.  I have been writing C# for about a year, but just recently learning web development.  I wrote an application that  connects to a MySql database and when I run it on my localhost it wokrs great!

    I created a ubuntu server on amazon ec2 and it is hosting my MySql server.  It is up and running just fine.

    I created a windows 2008 server instance on amazon ec2 to host my asp.net project.

    I published my project to my windows server and I went to my public IP address and my site was there!  it was so easy...

    However, when I went to login, I recieved this error:

    Could not load file or assembly 'MySql.Data, Version=, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The system cannot find the file specified.

    I made sure the correct connector was installed on ym server.  I have the most recent mysql connector installed.

    I do not know how the publish actually works.  I saw some forum posts that said maybe I was missing DLLs from my bin directory but I cannot even find my bin directory for my project on the server. 

    I also saw some posts about changing the web config file, but that was gibberish to me at this level.

    Any help would be appreciated, I think this is a simple fix.

    Friday, January 21, 2011 4:07 PM

All replies

  • User-562722113 posted

    The bin folder will be located at the root of your Website. This is where you store all of your assemblies that are specfic to your application should be stored and will be automatically picked up by your web app. My guess is that your missing an assembly called MySql.Data from that folder. Or if theres a reference in the web.config then its likely this assembly has not been installed into the GAC correctly. 

    Saturday, January 22, 2011 7:55 AM
  • User-562722113 posted


    Have you managed to resolve the issue?

    If this answer helped you please mark as answered.


    Tuesday, January 25, 2011 5:19 PM
  • User1805528910 posted

    On server its missing assembly of mysql or installed assembly on server is different. Now you need to place your mysql.data dll into bin folder and reference it from your bin. And check it it should work. 

    Monday, February 7, 2011 1:12 AM