0

我正在尝试使用 ubuntu 12.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 

我知道它已经安装并且我添加的它是作为我的项目的参考。

我的代码很简单如下:

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;
 }
}

当 is 到达构建文本编辑器的行时,即使编译正常,它也会抛出。有任何想法吗?

这是调试级别日志的输出。

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
4

1 回答 1

0

不要使用 MonoDevelop 3.x 代码,因为 MonoDevelop 4.0 刚刚发布,它带来了一些 API 重大更改。所以我建议你使用 monodevelop master 分支以防万一。

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

另外,这是什么版本的单声道?

于 2013-02-25T10:58:45.313 回答