0

Here problem is that I have install Mysql 6.9.5 on my local machine and it is working fine on local machine but after hosting on live server I am getting error as below.

Error Message

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

Web.config

<?xml version="1.0"?>

<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="MySql.Data, Version=6.9.5.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>
        <add assembly="MySql.Web, Version=6.9.5.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>
      </assemblies>
    </compilation>
    <httpRuntime/>
  </system.web>

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="MySql.Data" publicKeyToken="C5687FC88969C44D" culture="neutral" />
        <bindingRedirect oldVersion="5.5.32" newVersion="6.9.5.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

  <appSettings>        
    <add key="karmadbeConnection" value="server=*.*.*.*;User ID=*;Password=*;database=*;persist security info=False"/>       
  </appSettings>
</configuration>

Server Description

There is mysql 5.5.32version is installed on easycgi server. I hope there is version problem with server hosting. but not getting any solution.

if somebody have any solution or suggestion then it will be aceptable Thanks in advance.

Govinda Rajbhar
  • 2,926
  • 6
  • 37
  • 62

3 Answers3

0

to me it seems like problem with versions. Your code is saying "I want to use the 6.9.5" and server responds: "Ohh noo, you little website, I have only 5.5.32". Contact someone from the hosting company.

Eru
  • 332
  • 3
  • 17
0

I'd suggest listing all the loaded assemblies using the code below

Assembly[] asms = AppDomain.CurrentDomain.GetAssemblies();
foreach (Assembly asm in asms)
{
    Response.Write(asm.FullName  + "<br/>");
}

If you verify that the mysql.data.dll is located in bin folder, perhaps for some reason it's trying to use an older version loaded from GAC.

You can also try removing

<add assembly="MySql.Data, Version=6.9.5.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>

from web.config and see what happens.

EDIT

You might also want to check out how to load all assemblies from within your /bin directory.

Community
  • 1
  • 1
rasso
  • 2,131
  • 3
  • 21
  • 24
0

Put MySql Connector DLLS In Bin File Or ask your Provide Top install .net Connector

  1. MySql.Data
  2. MySql.Data.Entity
  3. MySql.Web

if Required Then Others Too You Can Find Them

C:\Program Files\MySQL\MySQL Connector Net 6.9.5\Assemblies\v4.0