Reputation: 59
I built an ASP.NET application using MySQL database. On my pc development server it works perfectly but gives the following error on host/production server
Error 0004: Could not load file or assembly 'MySql.Data.Entity,
Version=6.9.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies"
I used MySql connect version 6.9.7.0 but my host server uses MySql connector 6.2.5.0 which I feel causes the error. I tried rectifying my changing MySql.Data, MySql.Data.Entity, and MySql.Data.Entity.EF6 Specific Version property to 'false' but still no success.
I have tried using same connector as the host server but unfortunately is has no reference for MySql.Data.Entity.EF6 and wouldn't work.
Upvotes: 0
Views: 1537
Reputation: 1512
Most likely you need to select the reference MySql.Data and set Copy local to true
Because it is set to false it will not upload it when you publish.
Go to Solution explorer en select references , then select MySql.Data , Then in the Properties window set Copy Local to True.
And what also works is to copy the file MySql.Data to the bin folder on the server where you host your asp.net page
Upvotes: 1