locked
MySQL namespace could not be found (...) RRS feed

  • Question

  • User-1674951167 posted

    I used MySQL with VS some years ago, so apologies for that question. Is the following, I have: 

    win7 x64 
    VS 2010 

    and installed connector 6.3.6 and the community server. After using the GUI looks like mysql server is running ok. 

    I was surprised not founding mysql file to copy (i think back then it was a .dll), so when I took a look at documentation I found that it's integrated on VS 2010 (I think i'm right please correct me if im wrong)

    Just for test I created a new website with .NET 4.0 (also tried 3.5), on server explorer I added the connection (all ok) but when I compile I get: 


    Error 1 The type or namespace name 'MySql' could not be found (are you missing a using directive or an assembly reference?)

    at 

    using MySql.Data.MySqlClient; 
    using MySql.Data.Types; 

    How can I solve this problem?

    Tuesday, January 11, 2011 11:01 AM

Answers

  • User2050872319 posted

    .NET 3.5 was not really a full blown .NET framework version release, it still uses .NET CLR 2.0,

    only BCL libraries have been extended.

    So it's perfectly logical to have MySql.Data dlls compiled only for major versions of .NET CLR (which in

    this case will be 2.0 and 4). 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, January 12, 2011 4:06 PM

All replies

  • User2050872319 posted

    I'd suggest doing a file system search for MySql.Data dll and referencing them directly from your project.

    Ideally I'd create libs subfolder under the project root and put all the third party dependencies (dlls) there and reference

    them in the project.

    As far as I know, when one downloads Connector.NET it's not automatically installed in GAC so that means you have to 

    unzip the files and reference them directly from your .NET project.


    Hope this helps

    Tuesday, January 11, 2011 3:28 PM
  • User-1674951167 posted


    That's what I thought. The problem was finding the dll's for the 6.3.6 version (because its suppose to be integrated) - not available at download sections of MySQL official website.


    I eventually found those files at another site, and solved the problem that way.

    Wednesday, January 12, 2011 12:04 PM
  • User2050872319 posted

    MySql connector.net is available from the MySql official site:

    http://dev.mysql.com/downloads/connector/net/

    Wednesday, January 12, 2011 12:22 PM
  • User-1674951167 posted

    Of course it is, but no the dll files of 6.3.6 are available.

    Wednesday, January 12, 2011 12:53 PM
  • User2050872319 posted

    The second download option on the official MySql download page is the msi installer, when run,

    it installs all the required dlls into "C:\Program Files\MySQL\MySQL Connector Net 6.3.6" directory.

    All the required dlls can be found under Assemblies folder (there are 2 versions, one for .NET 2 

    and the other is for .NET 4).

    On 64 bit OS it will be installed under "C:\Program Files (x86)\MySQL\MySQL Connector Net 6.3.6".

    Wednesday, January 12, 2011 3:32 PM
  • User-1674951167 posted



    And for .NET 3.5 ?

    Wednesday, January 12, 2011 3:54 PM
  • User2050872319 posted

    .NET 3.5 was not really a full blown .NET framework version release, it still uses .NET CLR 2.0,

    only BCL libraries have been extended.

    So it's perfectly logical to have MySql.Data dlls compiled only for major versions of .NET CLR (which in

    this case will be 2.0 and 4). 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, January 12, 2011 4:06 PM
  • User-1674951167 posted

    Thanks I didnt know that.


    So... a curious thing, any chances of deploying a ".NET 2.0 supported" server, developed on .NET 3.5 and make it working?

    Wednesday, January 12, 2011 4:14 PM