2013-08-26 116 views
-2

我正在製作一個使用MySql.Data.dll連接到數據庫的應用程序。它在Windows上工作正常,但拒絕在Linux上工作(在Centos和Fedora上嘗試過)。我試着在Visual C#Express和MonoDevelop上編譯,在dll上下載另一個版本,使得項目.Net 2.0 ...沒有任何工作。。在Linux上使用MySql連接器的Net應用程序

我得到以下錯誤:

Unhandled Exception: System.ArgumentException: Format of initialization string does not conform to specifications at index 73. at System.Data.Common.DbConnectionStringBuilder.ParseConnectionStringNonOdbc (System.String connectionString) [0x00401] in /usr/src/mono/mcs/class/System.Data/System.Data.Common/DbConnectionStringBuilder.cs:771 at System.Data.Common.DbConnectionStringBuilder.ParseConnectionString (System.String connectionString) [0x00017] in /usr/src/mono/mcs/class/System.Data/System.Data.Common/DbConnectionStringBuilder.cs:531 at System.Data.Common.DbConnectionStringBuilder.set_ConnectionString (System.String value) [0x0001e] in /usr/src/mono/mcs/class/System.Data/System.Data.Common/DbConnectionStringBuilder.cs:97 at MySql.Data.MySqlClient.MySqlConnectionStringBuilder..ctor (System.String connStr) [0x00000] in :0 at MySql.Data.MySqlClient.MySqlConnection.set_ConnectionString (System.String value) [0x00000] in :0 at MySql.Data.MySqlClient.MySqlConnection..ctor (System.String connectionString) [0x00000] in :0 at (wrapper remoting-invoke-with-check) MySql.Data.MySqlClient.MySqlConnection:.ctor (string) at Plate.MySQLConnection.Select (System.Windows.Forms.DataGridView& _dataGrid, System.String[] select, System.String from, Plate.FieldValue[] where, System.String[] order_by) [0x0000f] in /home/ukus/Desktop/MonoDev/Place/MySQLConnection.cs:241 at Plate.GlavniForm.ReloadMeseci() [0x0006f] in /home/ukus/Desktop/MonoDev/Place/GlavniForm.cs:43 at Plate.GlavniForm..ctor() [0x00020] in /home/ukus/Desktop/MonoDev/Place/GlavniForm.cs:28 at (wrapper remoting-invoke-with-check) Plate.GlavniForm:.ctor() at Plate.Program.Main() [0x0000c] in /home/ukus/Desktop/MonoDev/Place/Program.cs:18 [ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentException: Format of initialization string does not conform to specifications at index 73. at System.Data.Common.DbConnectionStringBuilder.ParseConnectionStringNonOdbc (System.String connectionString) [0x00401] in /usr/src/mono/mcs/class/System.Data/System.Data.Common/DbConnectionStringBuilder.cs:771 at System.Data.Common.DbConnectionStringBuilder.ParseConnectionString (System.String connectionString) [0x00017] in /usr/src/mono/mcs/class/System.Data/System.Data.Common/DbConnectionStringBuilder.cs:531 at System.Data.Common.DbConnectionStringBuilder.set_ConnectionString (System.String value) [0x0001e] in /usr/src/mono/mcs/class/System.Data/System.Data.Common/DbConnectionStringBuilder.cs:97 at MySql.Data.MySqlClient.MySqlConnectionStringBuilder..ctor (System.String connStr) [0x00000] in :0 at MySql.Data.MySqlClient.MySqlConnection.set_ConnectionString (System.String value) [0x00000] in :0 at MySql.Data.MySqlClient.MySqlConnection..ctor (System.String connectionString) [0x00000] in :0 at (wrapper remoting-invoke-with-check) MySql.Data.MySqlClient.MySqlConnection:.ctor (string) at Plate.MySQLConnection.Select (System.Windows.Forms.DataGridView& _dataGrid, System.String[] select, System.String from, Plate.FieldValue[] where, System.String[] order_by) [0x0000f] in /home/ukus/Desktop/MonoDev/Place/MySQLConnection.cs:241 at Plate.GlavniForm.ReloadMeseci() [0x0006f] in /home/ukus/Desktop/MonoDev/Place/GlavniForm.cs:43 at Plate.GlavniForm..ctor() [0x00020] in /home/ukus/Desktop/MonoDev/Place/GlavniForm.cs:28 at (wrapper remoting-invoke-with-check) Plate.GlavniForm:.ctor() at Plate.Program.Main() [0x0000c] in /home/ukus/Desktop/MonoDev/Place/Program.cs:18

應用程序成功建立在雙方的Visual C#Express和MonoDevelop的。

+0

應用程序在Visual C#Express和MonoDevelop上都成功建立。 – Orvel

+0

顯示出現此錯誤的代碼 – Ehsan

+0

沒有「代碼發出此錯誤」。 – Orvel

回答

0

我發現了這個問題。由於連接字符串,該應用程序在Linux上無法工作。問題可能在於Mono不等同於.Net。

相關問題