Reputation: 113
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 ^^^^
Upvotes: 2
Views: 2657
Reputation: 25204
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!
Upvotes: 2