我想使用MonoDeveloper v:3.0.3.2中的Mono.Texteditor.dll在Ubuntu 12.04中创建我自己的文本编辑器。我已经把我的代码煮成最简单的例子,我似乎无法得到这个工作。我不断收到这个错误。使用Mono.TextEditor程序集来制作我自己的文本编辑器
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly
'Mono.TextEditor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of
its dependencies. File name: 'Mono.TextEditor, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null' at CVXmlEditor.MainClass.Main (System.String[] args) [0x00000]
in <filename unknown>:0
我知道它的安装,它在那里我添加是作为我的项目的参考。
我的代码很简单如下:
using System;
using Gtk;
using Mono.TextEditor;
public partial class MainWindow: Gtk.Window
{
public MainWindow(): base (Gtk.WindowType.Toplevel)
{
Build();
TextEditor te = new TextEditor();
}
protected void OnDeleteEvent (object sender, DeleteEventArgs a)
{
Application.Quit();
a.RetVal = true;
}
}
当就是获取到构建文本编辑器的线,它抛出即使它编译OK。有任何想法吗?
以下是调试级别日志的输出。
Mono: The following assembly referenced from /home/bryan/Work/CVXmlEditor/TestMonoEditor/TestMonoEditor/bin/Debug/TestMonoEditor.exe could not be loaded:
Assembly: Mono.TextEditor (assemblyref_index=2)
Version: 1.0.0.0
Public Key: (none)
The assembly was not found in the Global Assembly Cache, a path listed in the MONO_PATH environment variable, or in the location of the executing assembly (/home/bryan/Work/CVXmlEditor/TestMonoEditor/TestMonoEditor/bin/Debug/).
Mono: Failed to load assembly TestMonoEditor[0xf55400]
Mono: Could not load file or assembly 'Mono.TextEditor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
The application was terminated by a signal: SIGHUP
来自badgerports的单声道版本2.10.8.1-5。另外,如果我将TextEditor对象的构造移动到构造函数的外部,我立即得到TypeLoadException类型,就像编译它用于不同的体系结构一样。我的项目设置为.net4.0,即时通讯在64位机器上编译x86设置...这应该工作,不应该吗? – 2013-02-25 15:46:45
mono有一些错误引发TypeLoadException而不是FileNotFoundExceptions(如https://bugzilla.xamarin.com/show_bug.cgi?id=10354)所以一定要使用我链接的日志环境变量,所以找到根本原因 – knocte 2013-02-25 16:10:21
也应该无关紧要,因为它应该全部是托管代码;可能重要的是配置文件(4.0 vs 3.5 vs 2.0) – knocte 2013-02-25 16:10:44