BC30560: ‘MySqlConnection’ is ambiguous in the namespace ‘MySql.Data.MySqlClient’.

I got this error in one of my ASP.NET web sites after uploading a new version:

BC30560: ‘MySqlConnection’ is ambiguous in the namespace ‘MySql.Data.MySqlClient’.

It worked fine on my development machine but not on the production server. I could not figure out what it was for quite some time. Turned out I had added the mysql.dll to bin directory of my project and at the same time was referencing a shared (GAC) version of the same dll. I had made this and some other changes on the development machine that I had forgot about. The only thing that differed from the development and production machines was the web.config which I obviously did not check well enough.

Posting this here if someonelse or myself makes this stupid mistake again…

21 comments

  1. i came across this problem
    i tried everything but nothing happened

    after reading this post i tried removing reference, and imports consecutively.
    nothing worked.
    Actually, the problem was that i had uploaded, mysql.data.dll ,mysql.data.cf.dll and other assemblies all together, which caused that problem
    only you need is mysql.data.dll to be added to bin folder
    this Bin folder should be in placed where your app_code folder exists

  2. Hi Parikshit,

    Thank you for the suggestion, I have also follow the same and now i am getting one more error

    Parser Error Message: Unable to initialize provider. Missing or incorrect schema.

    Source Error:

    Line 22:
    Line 23:
    Line 24:
    Line 25:
    Line 26:

    Please help me…
    Thank you inadvance….

  3. Hola

    Un posible error esta en algun DATASET dentro de la carpeta APP_CODE.

    Prueba eliminandolo y podras ejecutar sin problemas.

Leave a Reply to Dobermaxx99 Cancel reply

Your email address will not be published. Required fields are marked *