ArgumentException after copy+paste RepoItem with screenshot

Bug reports.
bkruse
Posts: 38
Joined: Tue Jul 20, 2010 12:19 pm

ArgumentException after copy+paste RepoItem with screenshot

Post by bkruse » Thu Nov 04, 2010 3:44 pm

Hi,

to reproduce, create a new Repository.
Start any application (calculator app for example) and add an item to the repository.
Rightclick that item and select "Capture New Screenshot".
Save.
Select the root item.
Select Copy from the toolbar (or Ctrl+C).
Deselect all items (by clicking on the background).
Select Paste from the toolbar (or Ctrl+V).
=> an Error Message appears "Paste from cliboard failed." [OK]
Click OK.
Click any of the "New *" buttons in the toolbar. The Exception below will arise.

Additional information:
Removing the screenshot from the repository makes the copy 'n paste work.

Code: Select all

Ranorex Studio Version : 2.3.4.9270
.NET Version         : 2.0.50727.4952
OS Version           : Microsoft Windows NT 6.1.7600.0
Current culture      : German (Germany) (de-DE)
Working Set Memory   : 149996kb
GC Heap Memory       : 40276kb

Exception thrown:
System.ArgumentException: Ein Element mit dem gleichen Schlüssel wurde bereits hinzugefügt.
   bei System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   bei System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   bei Ranorex.Core.Repository.ElementRepository.CreateMemento()
   bei Ranorex.Core.Repository.ElementRepository.ComputeChangeStateHash()
   bei Ranorex.Core.Repository.ElementRepository.get_IsDirty()
   bei Ranorex.Controls.RepositoryEditor.OnRepositoryChanged(Boolean doUpdate, Boolean updateUndo)
   bei Ranorex.Controls.RepositoryEditor.toolStripButtonNewAppFolder_Click(Object sender, EventArgs e)
   bei System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   bei System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
   bei System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   bei System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   bei System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
   bei System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
   bei System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   bei System.Windows.Forms.Control.WndProc(Message& m)
   bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   bei System.Windows.Forms.ToolStrip.WndProc(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   bei System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

---- Recent log messages:
Failed to append recent log messages.
System.InvalidOperationException: Die Sequenz enthält keine Elemente.
   bei System.Linq.Enumerable.Single[TSource](IEnumerable`1 source)
   bei ICSharpCode.SharpDevelop.Sda.LogMessageRecorder.AppendRecentLogMessages(StringBuilder sb, ILog log)
   bei ICSharpCode.SharpDevelop.Sda.ExceptionBox.getClipboardString()

---- Post-error application state information:
Installed 3rd party AddIns: [RxLogViewer 2.3.4.9270], [RxObjectRepository 2.3.4.9270], [RxRecorder 2.3.4.9270], [Workflow Foundation Designer 2.3.4.9270], [ElementTree 2.3.4.9270]
Workbench.ActiveContent: RxObjectRepository.RepositoryPrimaryViewContent
ProjectService.OpenSolution: [Solution: FileName=C:\Users\bkruse\Documents\RanorexStudio Projects\BugProject\BugProject.rxsln, HasProjects=True, ReadOnly=False]
ProjectService.CurrentProject: [CSharpProject: BugProject]

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: ArgumentException after copy+paste RepoItem with screenshot

Post by Support Team » Thu Nov 04, 2010 4:07 pm

Hi,

Thank you for posting this bug. I was able to reproduce it and we will fix it with the next version of Ranorex.

Regards,
Peter
Ranorex Team
.
Image