error 0004: Could not load file or assembly 'MySql.Data.Entity, Version=6.9.7.0

asp.net c# entity-framework-6 mysql mysql-connector

Question

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.

1
0
1/17/2016 2:55:50 AM

Popular Answer

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.

enter image description here

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

1
1/17/2016 4:10:46 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow