Results 1 to 3 of 3

Thread: C# / Mono / MySQL library problems

  1. #1
    Join Date
    Sep 2005
    Beans
    153

    C# / Mono / MySQL library problems

    I'm working on a C# app compiled with Mono that does some work with MySQL. This development is being done in MonoDevelop on Ubuntu Dapper. When I try to import the appropriate libraries in my C# app, I get errors pertaining to the following imports:

    Code:
    using System.Data;
    using MySql.Data.MySqlClient;
    The errors are as follows:

    Code:
    The type or namespace name `System.Data' could not be found. Are you missing a using directive or an assembly reference?(CS0246)
    The type or namespace name `Data' does not exist in the namespace `System'. Are you missing an assembly reference?(CS0234)
    The type or namespace name `MySql.Data.MySqlClient' could not be found. Are you missing a using directive or an assembly reference?(CS0246)
    The type or namespace name `MySql' could not be found. Are you missing a using directive or an assembly reference?(CS0246)
    What am I missing?

  2. #2
    Join Date
    May 2009
    Beans
    7

    Re: C# / Mono / MySQL library problems

    Kethinov,

    check this: http://forums.mysql.com/read.php?47,...507#msg-166507

    Add this to your Web.config

    <compilation debug="true">
    <assemblies>
    <add assembly="MySql.Data, Version=5.0.7.0, Culture=neutral, PublicKeyToken=C5687FC88969C44D"/>
    </assemblies>
    </compilation>

    But if your version is say: 5.0.9.0 then you have to write the right version.

    Check it at the GAC,
    cd /usr/lib/mono/gac/MySql.Data
    ls
    then you will get something like:
    5.0.9.0__c5687fc88969c44d
    which is the <version number>_<public key>

    If your MySql.Data.dll is not registered in the GAC, then goto the directory of the file, then type:
    gac -i MySql.Data.dll
    Last edited by aaboelela; May 23rd, 2009 at 01:07 AM.

  3. #3
    Join Date
    Oct 2006
    Location
    /dev/null
    Beans
    1,574
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: C# / Mono / MySQL library problems

    In MonoDevelop, you need to make sure you have references set. In the Project Pane, right click on References, then Edit References - make sure System.Data and MySql are enabled.
    Understanding is a three-edged sword: Your side, their side, and the truth

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •