0

I am trying to make my own text editor using the Mono.Texteditor.dll from MonoDeveloper v:3.0.3.2 in ubuntu 12.04. I have boiled my code down to the simplest example and i cannot seem to get this to work. I keep getting this error.

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 

I know it's installed and it's there I added is as a reference to my project.

My code is simple as Follows:

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

When is gets to the line where the text editor is constructed, it throws even though it compiles ok. Any Ideas?

Here is the output from the debug level log.

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 4.0 がリリースされたばかりで、いくつかの API の重大な変更がもたらされるため、MonoDevelop 3.x コードは使用しないでください。そのため、念のため monodevelop master ブランチを使用することをお勧めします。

それを行っても、まだ例外が発生する場合は、Mono.TextEditor dll を実行可能ファイルと同じフォルダーに入れているのでしょうか? はいの場合は、ここ ( http://www.mono-project.com/Logging_Runtime_Events ) で説明されているいくつかの環境変数を調整して、ローダーがアセンブリを見つけられない理由を確認してください。

また、これはモノのどのバージョンですか?

于 2013-02-25T10:58:45.313 に答える