使用Mono.TextEditor程序集制作我自己的文本编辑器

使用Mono.TextEditor程序集制作我自己的文本编辑器,mono,monodevelop,text-editor,Mono,Monodevelop,Text Editor,我正在尝试使用Ubuntu12.04中MonoDeveloper v:3.0.3.2的Mono.Texteditor.dll制作自己的文本编辑器。我已经把我的代码归结为一个最简单的例子,但我似乎无法让它起作用。我一直在犯这个错误 Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Mono.TextEditor, Version=1.0.0.0, Culture=neutra

我正在尝试使用Ubuntu12.04中MonoDeveloper v:3.0.3.2的Mono.Texteditor.dll制作自己的文本编辑器。我已经把我的代码归结为一个最简单的例子,但我似乎无法让它起作用。我一直在犯这个错误

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 
当is到达构建文本编辑器的行时,即使编译为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

不要使用MonoDevelop3.x代码,因为MonoDevelop4.0刚刚发布,它带来了一些破坏API的变化。因此,我建议您使用monodevelop主分支,以防万一

完成后,如果仍然遇到该异常,我想知道是否将Mono.TextEditor dll与可执行文件放在同一文件夹中?如果是,则尝试调整此处()解释的一些环境变量,以了解加载程序如何无法找到程序集


另外,这是什么版本的mono?

badgerports的mono版本2.10.8.1-5。此外,如果我将TextEditor对象的构造移动到构造函数外部的全局结构,我会立即得到一个TypeLoadException,类似于为不同的体系结构编译的。我的项目设置为.net4.0,在64位计算机上使用im在设置中编译x86。。。这应该行得通,不是吗?mono在抛出TypeLoadException而不是FileNotFoundExceptions(如)方面存在一些错误,因此请确保使用我链接的日志环境变量,以便找到根本原因,这样arch就不重要了,因为它都应该由代码管理;重要的是配置文件(4.0 vs 3.5 vs 2.0),我将启用日志记录,并在明天告诉您发生了什么。谢谢你的帮助。日志输出在上面。看起来好像root拥有该.dll,我需要将其放入GAC,或者获取副本的所有权并将其放入我的项目中。正确的?
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