Length cannot be less than Zero
We have encountered this error in spellchecking German
Language Files and our investigations have led us to
believe that the error is caused because the German
Language file is checked using the English
Dictionaries. We encountered the error with the letter
“ß” which is equal to “SS” in German. Since the English
dictionary lacked the entry for “SS” the error was
generated.
Following is the Exception Text
************** Exception Text **************
System.ArgumentOutOfRangeException: Length cannot be
less than zero.
Parameter name: length
at System.String.Substring(Int32 startIndex, Int32
length)
at System.String.Substring(Int32 startIndex)
at
NetSpell.SpellChecker.Spelling.ReplaceChars(ArrayList&
tempSuggestion)
at NetSpell.SpellChecker.Spelling.Suggest()
at
NetSpell.SpellChecker.Forms.SuggestionForm.SpellChecker_MisspelledWord(Object
sender, SpellingEventArgs e)
at
NetSpell.SpellChecker.Spelling.OnMisspelledWord(SpellingEventArgs
e)
at NetSpell.SpellChecker.Spelling.SpellCheck(Int32
startWordIndex, Int32 endWordIndex)
at NetSpell.SpellChecker.Spelling.SpellCheck()
at
NetSpell.SpellChecker.Forms.SuggestionForm.IgnoreButton_Click(Object
sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at
System.Windows.Forms.Button.OnMouseUp(MouseEventArgs
mevent)
at System.Windows.Forms.Control.WmMouseUp(Message&
m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at
System.Windows.Forms.ControlNativeWindow.OnMessage(Message&
m)
at
System.Windows.Forms.ControlNativeWindow.WndProc(Message&
m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr
hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/winnt/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
TextEditor
Assembly Version: 2.1.2.40240
Win32 Version: 2.1.2.40240
CodeBase:
file:///D:/GEN-APPS/newtools/spellcheckernetspell/Sample%20Editor%20Version%202/bin/Debug/TextEditor.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/winnt/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/winnt/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
System.Xml
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/winnt/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase:
file:///c:/winnt/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
NetSpell.SpellChecker
Assembly Version: 2.1.7.40230
Win32 Version: 2.1.7.40230
CodeBase:
file:///D:/GEN-APPS/newtools/spellcheckernetspell/Sample%20Editor%20Version%202/bin/Debug/NetSpell.SpellChecker.DLL
----------------------------------------
RegexAssembly4_0
Assembly Version: 0.0.0.0
Win32 Version: n/a
CodeBase:
----------------------------------------
Error Screen