I am starting to develop some applications using mono and MySQL. Experimenting with these tools, I tried using Connecotr / net from MySql. I downloaded the latest version and installed it, as the documentation says.
I created a small console application to test my MySQL connection. Here are a few lines of code I:
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!"); }
No problem creating the application. But when I run it, this error occurs:
The .ctor method is missing in the assembly / Users / Patrick / Projects / MySqlTest 2 / MySqlTest2 / bin / Debug / MySql.Data.dll, enter System.Security.SecurityRulesAttribute Cannot find the custom constructor image attr: / Users / Patrick / Projects / MySqlTest2 /MySqlTest2/bin/Debug/MySql.Data.dll mtoken: 0x0a00002b
Unhandled exception: System.TypeLoadException: Failed to load type 'System.Security.SecurityRulesAttribute' from assembly 'MySql.Data'. in MySqlTest2.MainClass.Main (System.String [] args) [0x00006] in / Users / Patrick / Projects / MySqlTest 2 / MySqlTest2 / Main.cs: 12
Have any of you had this problem? Could you solve it?
I want my application to run on different platforms, and also have to update different clients, each of which has its own database, via the Internet. So I decided to use Mono and MySQL. If someone knows the best database for this task, this could also be an option. I do not want to use Java or any other programming language, because I have some experience developing .net applications on Windows.
Thanks for helping me!
source share