Bug #62179 Missing method .ctor in assembly
Submitted: 16 Aug 2011 14:13 Modified: 15 Sep 2011 21:18
Reporter: Patrick Weegen Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / NET Severity:S1 (Critical)
Version:6.4.3 OS:MacOS (10.7)
Assigned to: CPU Architecture:Any
Tags: .ctor Missing, Lion, mac, Mono

[16 Aug 2011 14:13] Patrick Weegen
Description:
If I use the Connector for .net  on a project created with MonoDevelop on Mac OS X I get the following error message when executing the Programm: 

Missing method .ctor in assembly /Users/Patrick/Projects/MySqlTest2/MySqlTest2/bin/Debug/MySql.Data.dll, type System.Security.SecurityRulesAttribute Can't find custom attr constructor image: /Users/Patrick/Projects/MySqlTest2/MySqlTest2/bin/Debug/MySql.Data.dll mtoken: 0x0a00002b

Unhandled Exception: System.TypeLoadException: Could not load type 'System.Security.SecurityRulesAttribute' from assembly 'MySql.Data'. at MySqlTest2.MainClass.Main (System.String[] args) [0x00006] in /Users/Patrick/Projects/MySqlTest2/MySqlTest2/Main.cs:12

How to repeat:
Using this code with latest MONO-Framework:

public static void Main (string[] args)
{
    string connString = "Server=localhost;Database=feuerwehr;Uid=XXX;Pwd=XXX;";
    MySqlConnection conn = new MySqlConnection (connString);
    try {
        Console.WriteLine ("Connection to MySQL ...");
        conn.Open ();
    } catch (Exception ex) {
        Console.WriteLine (ex.Message);
    }
    conn.Close ();
    Console.WriteLine ("Done!");
}

Suggested fix:
Making Connector/Net compatible with MONO-Framework
[10 Sep 2011 15:02] Patrick Weegen
I'm Stil waiting for any Reaction of any developer!

I'm starting to look for any other database to use for my project!
[15 Sep 2011 21:18] Reggie Burnett
First, let me say that I'm sorry it took us so long to get to this.  We are working through our bug backlog but it can take time.

Second, I tried to reproduce this using Mono on Windows compiling for both .net 3.5 and .net 4.0. I also used the latest mono on Mac OSX Lion compiling for both .net 3.5 and .net 4.0.  I used your sample code and referenced a 6.4.3 assembly and the latest 6.3 and 6.4 assemblies.  Not once did I get any type of exception dealing with loading of assemblies or unable to find a ctor.

It's possible it's a bug in Mono so I would suggest you make sure you are using the latest version. If you get additional information to help me reproduce it, please reopen the bug.