Bug 1314 - Exception when editing Reference.cs file.
Summary: Exception when editing Reference.cs file.
Status: RESOLVED FIXED
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: Text Editor ()
Version: 2.8 Beta 2
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Mike Krüger
URL:
: 1386 ()
Depends on:
Blocks:
 
Reported: 2011-10-06 12:30 UTC by Miguel de Icaza [MSFT]
Modified: 2011-10-10 02:24 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Problematic source file (13.88 KB, application/octet-stream)
2011-10-06 13:18 UTC, Miguel de Icaza [MSFT]
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Miguel de Icaza [MSFT] 2011-10-06 12:30:54 UTC
System.ArgumentException: An element with the same key already exists in the dictionary.
  at System.Collections.Generic.Dictionary`2[Mono.TextEditor.LineSegment,Mono.TextEditor.TextViewMargin+ChunkDescriptor].Add (Mono.TextEditor.LineSegment key, Mono.TextEditor.ChunkDescriptor value) [0x00171] in /private/tmp/monobuild/build/BUILD/mono-2.10.5/mcs/class/corlib/System.Collections.Generic/Dictionary.cs:437 
  at Mono.TextEditor.TextViewMargin.GetCachedChunks (Mono.TextEditor.Highlighting.SyntaxMode mode, Mono.TextEditor.Document doc, Mono.TextEditor.Highlighting.ColorSheme style, Mono.TextEditor.LineSegment line, Int32 offset, Int32 length) [0x00058] in /private/tmp/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/TextViewMargin.cs:851 
  at Mono.TextEditor.TextViewMargin+<CreateLinePartLayout>c__AnonStorey48.<>m__71 (Mono.TextEditor.LayoutWrapper wrapper) [0x000b8] in /private/tmp/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/TextViewMargin.cs:1038 
  at Mono.TextEditor.TextViewMargin.GetCachedLayout (Mono.TextEditor.LineSegment line, Int32 offset, Int32 length, Int32 selectionStart, Int32 selectionEnd, System.Action`1 createNew) [0x00092] in /private/tmp/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/TextViewMargin.cs:786 
  at Mono.TextEditor.TextViewMargin.CreateLinePartLayout (Mono.TextEditor.Highlighting.SyntaxMode mode, Mono.TextEditor.LineSegment line, Int32 logicalRulerColumn, Int32 offset, Int32 length, Int32 selectionStart, Int32 selectionEnd) [0x00042] in /private/tmp/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/TextViewMargin.cs:1030 
  at Mono.TextEditor.TextViewMargin.CreateLinePartLayout (Mono.TextEditor.Highlighting.SyntaxMode mode, Mono.TextEditor.LineSegment line, Int32 offset, Int32 length, Int32 selectionStart, Int32 selectionEnd) [0x00000] in /private/tmp/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/TextViewMargin.cs:1025 
  at Mono.TextEditor.TextViewMargin.GetLayout (Mono.TextEditor.LineSegment line) [0x0003b] in /private/tmp/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/TextViewMargin.cs:1254 
  at MonoDevelop.SourceEditor.MessageBubbleTextMarker.CalculateLineFit (Mono.TextEditor.TextEditor editor, Mono.TextEditor.LineSegment lineSegment) [0x00018] in /private/tmp/source/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs:163 
  at MonoDevelop.SourceEditor.MessageBubbleTextMarker.GetLineHeight (Mono.TextEditor.TextEditor editor) [0x00052] in /private/tmp/source/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/MessageBubbleTextMarker.cs:116 
  at MonoDevelop.SourceEditor.SourceEditorView.<SourceEditorView>m__33 (System.Object sender, Mono.TextEditor.LineEventArgs e) [0x00086] in /private/tmp/source/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorView.cs:162 
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_LineEventArgs (object,Mono.TextEditor.LineEventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_LineEventArgs (object,Mono.TextEditor.LineEventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_LineEventArgs (object,Mono.TextEditor.LineEventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_LineEventArgs (object,Mono.TextEditor.LineEventArgs)
  at (wrapper delegate-invoke) <Module>:invoke_void__this___object_LineEventArgs (object,Mono.TextEditor.LineEventArgs)
  at Mono.TextEditor.Document.SplitterLineSegmentTreeLineChanged (System.Object sender, Mono.TextEditor.LineEventArgs e) [0x0000b] in /private/tmp/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document.cs:130 
  at Mono.TextEditor.LineSplitter.OnLineChanged (Mono.TextEditor.LineEventArgs e) [0x0000d] in /private/tmp/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/LineSplitter.cs:393 
  at Mono.TextEditor.LineSplitter.ChangeLength (Mono.TextEditor.TreeNode line, Int32 newLength, Int32 delimiterLength) [0x0000e] in /private/tmp/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/LineSplitter.cs:385 
  at Mono.TextEditor.LineSplitter.ChangeLength (Mono.TextEditor.TreeNode line, Int32 newLength) [0x00000] in /private/tmp/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/LineSplitter.cs:378 
  at Mono.TextEditor.LineSplitter.TextInsert (Int32 offset, System.String text) [0x000b2] in /private/tmp/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/LineSplitter.cs:201 
  at Mono.TextEditor.LineSplitter.TextReplaced (System.Object sender, Mono.TextEditor.ReplaceEventArgs args) [0x0002e] in /private/tmp/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/LineSplitter.cs:98 
  at Mono.TextEditor.Document.Mono.TextEditor.IBuffer.Replace (Int32 offset, Int32 count, System.String value) [0x000f0] in /private/tmp/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/Document.cs:228 
  at Mono.TextEditor.TextEditorData.Replace (Int32 offset, Int32 count, System.String value) [0x00009] in /private/tmp/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditorData.cs:268 
  at Mono.TextEditor.TextEditorData.Insert (Int32 offset, System.String value) [0x00000] in /private/tmp/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditorData.cs:208 
  at Mono.TextEditor.EditMode.InsertCharacter (UInt32 unicodeKey) [0x00323] in /private/tmp/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/EditMode.cs:139 
  at Mono.TextEditor.SimpleEditMode.HandleKeypress (Key key, UInt32 unicodeKey, ModifierType modifier) [0x0003c] in /private/tmp/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/SimpleEditMode.cs:397 
  at Mono.TextEditor.EditMode.InternalHandleKeypress (Mono.TextEditor.TextEditor editor, Mono.TextEditor.TextEditorData data, Key key, UInt32 unicodeChar, ModifierType modifier) [0x0000e] in /private/tmp/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/EditMode.cs:48 
  at Mono.TextEditor.TextEditor.SimulateKeyPress (Key key, UInt32 unicodeChar, ModifierType modifier) [0x00008] in /private/tmp/source/monodevelop/main/src/core/Mono.Texteditor/Mono.TextEditor/TextEditor.cs:795 
  at MonoDevelop.SourceEditor.SourceEditorWidget.MonoDevelop.Ide.Gui.Content.ITextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00000] in /private/tmp/source/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/SourceEditorWidget.cs:126 
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /private/tmp/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:115 
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /private/tmp/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:115 
  at MonoDevelop.CSharp.Formatting.CSharpTextEditorIndentation.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00361] in /private/tmp/source/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Formatting/CSharpTextEditorIndentation.cs:261 
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /private/tmp/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:115 
  at MonoDevelop.Ide.Gui.Content.CompletionTextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x0005a] in /private/tmp/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/CompletionTextEditorExtension.cs:94 
  at MonoDevelop.CSharp.Completion.CSharpTextEditorCompletion.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00000] in /private/tmp/source/monodevelop/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Completion/CSharpTextEditorCompletion.cs:178 
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /private/tmp/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:115 
  at MonoDevelop.DocFood.DocFoodTextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00008] in /private/tmp/source/monodevelop/main/src/addins/MonoDevelop.DocFood/MonoDevelop.DocFood/DocFoodTextEditorExtension.cs:63 
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /private/tmp/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:115 
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /private/tmp/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:115 
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /private/tmp/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:115 
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /private/tmp/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:115 
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /private/tmp/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:115 
  at MonoDevelop.Ide.Gui.Content.TextEditorExtension.KeyPress (Key key, Char keyChar, ModifierType modifier) [0x00013] in /private/tmp/source/monodevelop/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui.Content/TextEditorExtension.cs:115 
  at MonoDevelop.SourceEditor.ExtensibleTextEditor.ExtensionKeyPress (Key key, UInt32 ch, ModifierType state) [0x00000] in /private/tmp/source/monodevelop/main/src/addins/MonoDevelop.SourceEditor2/MonoDevelop.SourceEditor/ExtensibleTextEditor.cs:257
Comment 1 Miguel de Icaza [MSFT] 2011-10-06 13:18:26 UTC
Created attachment 626 [details]
Problematic source file

The error happens when editing this file, the steps to reproduce are:

Copy the following string into your clipboard, without newlines:

http://xml-diensten.accell-group.com:9080/Accentry/services/WSVDealerInfoServices

Then go to line 41, that reads:

this.Url = global::etc

After the "=" sign Type double quotes, ", then paste the above url, and then enter another double quote '"', that will produce the error

It is possible that you might need to add this as a hidden Web Reference, I am not sure though.  I copied this from Windows.
Comment 2 Mike Krüger 2011-10-07 02:24:58 UTC
Did you use final 2. 8 or one of the betas ?

And did the beta have the semantic hlighlighting feature ?

Shouldn't happen again.
Comment 3 Miguel de Icaza [MSFT] 2011-10-07 17:10:15 UTC
This is with the final MonoDevelop 2.8.
Comment 4 Mike Krüger 2011-10-10 02:05:49 UTC
Y but I fixed it in master - reopen, if you can repro it with master. I can't repro it on my computer, but the stack trace helped - but since I can't repro it may be an error somewhere else. I just was curious why that could happen.
Comment 5 Mike Krüger 2011-10-10 02:24:00 UTC
*** Bug 1386 has been marked as a duplicate of this bug. ***
Comment 6 Mike Krüger 2011-10-10 02:24:34 UTC
The bug is fixed in master, I could repro it now - another user found that as well.