2
using System;
using MySql.Data.MySqlClient;
namespace Input
{
    class MainClass
    {
        public static void Main (string[] args)
        {
            string connectionString = "server=SQL09.FREEMYSQL.NET;database=m44m31;uid=m44m31;pwd=*******"; 
            MySqlConnection conn = new MySqlConnection(connectionString);
            try
            {
                conn.Open();
            }
            catch
            {
                Console.WriteLine("Failed to connect");
            }
        }
    }
}

there is my code and here is the error i keep getting...i'm using mono on ubuntu:

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'MySql.Data, Version=6.5.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies.
File name: 'MySql.Data, Version=6.5.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d'
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not load file or assembly 'MySql.Data, Version=6.5.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies.
File name: 'MySql.Data, Version=6.5.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d'

i really don't know what to do and have searched every where, please help!

    [assembly: AssemblyVersion ("6.5.5.0")]
[assembly: InternalsVisibleTo ("MySql.Data.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d973bda91f71752c78294126974a41a08643168271f65fc0fb3cd45f658da01fbca75ac74067d18e7afbf1467d7a519ce0248b13719717281bb4ddd4ecd71a580dfe0912dfc3690b1d24c7e1975bf7eed90e4ab14e10501eedf763bff8ac204f955c9c15c2cf4ebf6563d8320b6ea8d1ea3807623141f4b81ae30a6c886b3ee1")]
[assembly: AssemblyConfiguration ("")]
[assembly: AssemblyKeyName ("ConnectorNet")]
[assembly: InternalsVisibleTo ("MySql.Data.CF.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d973bda91f71752c78294126974a41a08643168271f65fc0fb3cd45f658da01fbca75ac74067d18e7afbf1467d7a519ce0248b13719717281bb4ddd4ecd71a580dfe0912dfc3690b1d24c7e1975bf7eed90e4ab14e10501eedf763bff8ac204f955c9c15c2cf4ebf6563d8320b6ea8d1ea3807623141f4b81ae30a6c886b3ee1")]
[assembly: InternalsVisibleTo ("MySql.Data.Entity, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d973bda91f71752c78294126974a41a08643168271f65fc0fb3cd45f658da01fbca75ac74067d18e7afbf1467d7a519ce0248b13719717281bb4ddd4ecd71a580dfe0912dfc3690b1d24c7e1975bf7eed90e4ab14e10501eedf763bff8ac204f955c9c15c2cf4ebf6563d8320b6ea8d1ea3807623141f4b81ae30a6c886b3ee1")]
[assembly: Debuggable (DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: CompilationRelaxations (8)]
[assembly: RuntimeCompatibility (WrapNonExceptionThrows = true)]
[assembly: TargetFramework (".NETFramework,Version=v4.0", FrameworkDisplayName = ".NET Framework 4")]
[assembly: AssemblyDescription ("ADO.Net driver for MySQL")]
[assembly: AssemblyCompany ("Oracle")]
[assembly: AssemblyProduct ("")]
[assembly: AssemblyCopyright ("Copyright © 2004, 2010, Oracle and/or its affiliates. All rights reserved.")]
[assembly: AssemblyTrademark ("")]
[assembly: ComVisible (false)]
[assembly: CLSCompliant (false)]
[assembly: AssemblyTitle ("MySql.Data.dll")]
[assembly: AllowPartiallyTrustedCallers ]
[assembly: SecurityRules (SecurityRuleSet.Level1)]
[assembly: AssemblyDelaySign (false)]

It is added to the assembly ^^^^

7
  • Check your database name, it is missing the file type extension... Commented Dec 9, 2012 at 18:50
  • Your confusing me...explain? Commented Dec 9, 2012 at 18:58
  • database=m44m31 This is database name, right?? So it has to be an extension. Commented Dec 9, 2012 at 19:01
  • i mean like .sdf, .mdf and like so....Hope you got it this time Commented Dec 9, 2012 at 19:06
  • 1
    You don't need an extension on the db name. Commented Dec 9, 2012 at 19:07

1 Answer 1

2

It appears that you have a broken reference to the MySql.Data dll. Verify that the .csproj file contains the reference to the correct dll and that the dll exists in the proper location. Please post more info if this doesn't fix your problem!

Sign up to request clarification or add additional context in comments.

11 Comments

its added as a reference and i don't think its corrupted...i downloaded it from the official MySQL website...what other info do you need?
Yes it does, What other info do you need?
Did you do an MD5 on the download? (I had a corrupted download at one time).
i'm going to re-download and see if it helps
Do an MD5 when you do just to be sure.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.