This project is read-only.

Setting Language

Topics: Developer Forum, User Forum
Jun 11, 2010 at 11:45 PM

I'm having a problem, I drop the Scintilla control on my form and call <The Editor>.ConfigurationManager.Language to xml however an exception seems to be thrown and I'm unsure why?

Jun 12, 2010 at 3:25 AM

Can you please post the exception and stack trace?

 

Jacob

 

 

Jun 12, 2010 at 1:00 PM

Yeh sure it's:

 

System.ArgumentNullException: Value cannot be null.
Parameter name: input
   at System.Xml.XmlReader.CreateReaderImpl(Stream input, XmlReaderSettings settings, Uri baseUri, String baseUriStr, XmlParserContext inputContext, Boolean closeInput)
   at System.Xml.XmlReader.Create(Stream input, XmlReaderSettings settings, String baseUri)
   at System.Xml.XmlReader.Create(Stream input, XmlReaderSettings settings)
   at ScintillaNet.Configuration.Configuration.Load(Stream inStream, Boolean useXmlReader) in D:\Projects\My\Libraries\Editor\Configuration\Configuration.cs:line 97
   at ScintillaNet.Configuration.Configuration..ctor(Stream inStream, String language, Boolean useXmlReader) in D:\Projects\My\Libraries\Editor\Configuration\Configuration.cs:line 51
   at ScintillaNet.Configuration.ConfigurationManager.Configure() in D:\Projects\My\Libraries\Editor\Configuration\ConfigurationManager.cs:line 364
   at ScintillaNet.Configuration.ConfigurationManager.set_Language(String value) in D:\Projects\My\Libraries\Editor\Configuration\ConfigurationManager.cs:line 63
   at My.MainForm.CreateDocument(String text) in D:\Projects\My\Applications\Main Application\MainForm.cs:line 61
   at My.MainForm.toolStripButton1_Click(Object sender, EventArgs e) in D:\Projects\My\Applications\Main Application\MainForm.cs:line 76
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
sharpnote
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///D:/Projects/SharpNote/Bin/Debug/sharpnote.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
My.Core
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///D:/Projects/My/Bin/Debug/My.Core.DLL
----------------------------------------
System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
My.Docking
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///D:/Projects/My/Bin/Debug/My.Docking.DLL
----------------------------------------
My.Editor
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///D:/Projects/My/Bin/Debug/My.Editor.DLL
----------------------------------------


Jun 12, 2010 at 7:14 PM

I don't know, it seems like a weird place to get an exception. It's reading the xml config from the resources but the XmlReader is getting passed a null stream. 2 things I would try offhand:

  1. Use a different language like "cs" (c#)
  2. Turn off UseXmlReader

Neither of these would fix your problem, just trying to get a feel for what's going on

Jun 12, 2010 at 10:23 PM

I think I've found the source of the problem, I copied the Scintilla files into my own assembly and given what you mentioned about xml config I checked and the Configuration folder files were not set to "Embedded Resource" so I  switched to that, however the problem still persists so I'm probably missing something else like that.

 

IIf I use the normal ScintillaNET bindings then it all works ok, I'll keep it like that until I can figure out where copying is going wrong.