我正在使用 mono 从我的 USB 磁盘运行 .net4 应用程序,并且运行良好。
我将完整的应用程序文件夹复制到硬盘(桌面),然后使用 mono 启动我的应用程序,但出现错误“未找到某些内容”...
我没有发现问题,因为它在我的 USB 驱动器上运行良好。而且我确信所有文件都已复制,都在一个目录中)
错误全文如下:
Unhandled Exception: System.InvalidOperationException: WinForms_SeeInnerException ---> System.IO.FileNotFoundException: Could not load file or assembly 'MySql.Data, Version=6.7.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies.
File name: 'MySql.Data, Version=6.7.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d'
at System.Windows.Forms.ToolStripItem.OnTextChanged (System.EventArgs e) [0x00000] in <filename unknown>:0
at System.Windows.Forms.ToolStripItem.set_Text (System.String value) [0x00000] in <filename unknown>:0
at Redesigned_Integration_Platform.frmMain.InitializeComponent () [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) Redesigned_Integration_Platform.frmMain:InitializeComponent ()
at Redesigned_Integration_Platform.frmMain..ctor () [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at Redesigned_Integration_Platform.My.MyProject+MyForms.Create__Instance__[frmMain] (Redesigned_Integration_Platform.frmMain Instance) [0x00000] in <filename unknown>:0
at Redesigned_Integration_Platform.My.MyProject+MyForms.get_frmMain () [0x00000] in <filename unknown>:0
at Redesigned_Integration_Platform.My.MyApplication.OnCreateMainForm () [0x00000] in <filename unknown>:0
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun () [0x00000] in <filename unknown>:0
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run (System.String[] commandLine) [0x00000] in <filename unknown>:0
at Redesigned_Integration_Platform.My.MyApplication.Main (System.String[] Args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidOperationException: WinForms_SeeInnerException ---> System.IO.FileNotFoundException: Could not load file or assembly 'MySql.Data, Version=6.7.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies.
File name: 'MySql.Data, Version=6.7.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d'
at System.Windows.Forms.ToolStripItem.OnTextChanged (System.EventArgs e) [0x00000] in <filename unknown>:0
at System.Windows.Forms.ToolStripItem.set_Text (System.String value) [0x00000] in <filename unknown>:0
at Redesigned_Integration_Platform.frmMain.InitializeComponent () [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) Redesigned_Integration_Platform.frmMain:InitializeComponent ()
at Redesigned_Integration_Platform.frmMain..ctor () [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (System.Reflection.MonoCMethod,object,object[],System.Exception&)
at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at Redesigned_Integration_Platform.My.MyProject+MyForms.Create__Instance__[frmMain] (Redesigned_Integration_Platform.frmMain Instance) [0x00000] in <filename unknown>:0
at Redesigned_Integration_Platform.My.MyProject+MyForms.get_frmMain () [0x00000] in <filename unknown>:0
at Redesigned_Integration_Platform.My.MyApplication.OnCreateMainForm () [0x00000] in <filename unknown>:0
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun () [0x00000] in <filename unknown>:0
at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run (System.String[] commandLine) [0x00000] in <filename unknown>:0
at Redesigned_Integration_Platform.My.MyApplication.Main (System.String[] Args) [0x00000] in <filename unknown>:0
答案1
您需要安装 mysql-connector-net 包:
开发包(构建/使用 monodevelop 所需)
sudo apt-get install libmysql-cil-dev
运行时包(运行所需)开发包将自动将其拉入
sudo apt-get install libmysql6.4-cil