[Mono-dev] Application throws exception when run from command-line, but not when run from MonoDevelop...

Quandary quandary82 at hailmail.net
Sun Apr 17 16:18:37 EDT 2011


Hi,

I'm working on getting the ICSharpCode.TextEditor running on Linux for
highlighting SQL.

Basically, the main stuff is from here:
http://www.codeproject.com/Articles/111969/Extending-ICSharpCode-TextEditor-Syntax-Highlighti.asp

I downloaded ICSharpCode.TextEditor sources and fixed the system calls
so that it runs on Linux in WinForms. (well, without scrollbars).

Now, it works fine everywhere when it doesn't perform highlight syntax.
It also works fine doing SQL syntax highlighting when it's run from
within MonoDevelop, Debug and Release config.

But when I start the application with syntax highlighting from the
command line with
./ExecutableName.exe
it throws the below exception.

When I start it with mono ./ExecutableName.exe
then it also works fine from the command line.

Unfortunately for you guys, binfmt-support is installed, so this seems
to be a bug (since it works fine with everything else).

Is it loading a different mono runtime when run with binfmt-support, or
having a different behaviour, for example because the running process
name (also filename/path) for running it with binfmt-support is not
[/usr/bin/]mono, but [/opt/whatever/]ExecutableName.exe ?

Here the exception (seems to be complaining about the XML
targetNamespace [ICSharpCode.TextEditor uses XML and XSHD as embedded
ressource], but can't be an error in the XML because it works fine on
Windows and when not run with binfmt-support):
-----------
SQL-Mode.xshd
ICSharpCode.TextEditor.Document.HighlightingDefinitionInvalidException:
Could not load mode definition file 'SQL-Mode.xshd'.
 --->
ICSharpCode.TextEditor.Document.HighlightingDefinitionInvalidException:
The targetNamespace attribute cannot have have empty string as its value.

  at ICSharpCode.TextEditor.Document.HighlightingDefinitionParser.Parse
(ICSharpCode.TextEditor.Document.DefaultHighlightingStrategy
highlighter, ICSharpCode.TextEditor.Document.SyntaxMode syntaxMode,
System.Xml.XmlReader xmlReader) [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at ICSharpCode.TextEditor.Document.HighlightingDefinitionParser.Parse
(ICSharpCode.TextEditor.Document.DefaultHighlightingStrategy
highlighter, ICSharpCode.TextEditor.Document.SyntaxMode syntaxMode,
System.Xml.XmlReader xmlReader) [0x00000] in <filename unknown>:0
  at ICSharpCode.TextEditor.Document.HighlightingDefinitionParser.Parse
(ICSharpCode.TextEditor.Document.SyntaxMode syntaxMode,
System.Xml.XmlReader xmlReader) [0x00000] in <filename unknown>:0
  at ICSharpCode.TextEditor.Document.HighlightingManager.LoadDefinition
(DictionaryEntry entry) [0x00000] in <filename unknown>:0
  at ICSharpCode.TextEditor.Document.HighlightingManager.FindHighlighter
(System.String name) [0x00000] in <filename unknown>:0
  at
ICSharpCode.TextEditor.Document.HighlightingStrategyFactory.CreateHighlightingStrategy
(System.String name) [0x00000] in <filename unknown>:0
  at ICSharpCode.TextEditor.TextEditorControl.SetHighlighting
(System.String name) [0x00000] in <filename unknown>:0
  at SQLquery.Form1.InitializeSyntaxHighlighting () [0x00000] in
<filename unknown>:0
  at SQLquery.Form1.Form1_Load (System.Object sender, System.EventArgs
e) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Form.OnLoad (System.EventArgs e) [0x00000] in
<filename unknown>:0
  at System.Windows.Forms.Form.OnLoadInternal (System.EventArgs e)
[0x00000] in <filename unknown>:0
root at IS1300-1:~/Projects/ICSharpCode.TextEditor/SQLquery/bin/Release#
-----------------------




More information about the Mono-devel-list mailing list