The "Unexpected exception encountered" window is displayed when opening any file in project

Experiences, small talk, and other automation gossip.
ngocRose
Posts: 4
Joined: Thu Jun 24, 2021 9:24 am

The "Unexpected exception encountered" window is displayed when opening any file in project

Post by ngocRose » Fri Jul 23, 2021 3:46 am

Hi everyone,
I recently encountered the following problem:
After i merge the code and run the script, i can't open any files in my project it shows the window like attached image.
I tried reinstalling ranorex but it still doesn't work
Ranorex: 9.3.2
OS: Windows 10
Please help me, many thanks
Details of error

Code: Select all

System.NullReferenceException: Object reference not set to an instance of an object.
---STACKTRACE---
System.NullReferenceException: Object reference not set to an instance of an object.
  ICSharpCode.SharpDevelop.Gui.AvalonDockLayout.get_WorkbenchWindows() +0x0
  ICSharpCode.SharpDevelop.Gui.WpfWorkbench.get_WorkbenchWindowCollection() +0xd
  ICSharpCode.SharpDevelop.Gui.WpfWorkbench+<>c__DisplayClass55_0.<get_ViewContentCollection>b__0() +0x0
  ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.SafeThreadCall(Action method) +0x11
  ICSharpCode.SharpDevelop.Gui.WpfWorkbench.get_ViewContentCollection() +0x2a
  ICSharpCode.SharpDevelop.FileService.GetOpenFile(String fileName,Type viewContentType) +0x0
  ICSharpCode.SharpDevelop.FileService.OpenFile(String fileName,Boolean switchToOpenedView,FileOperationResult& fileResult) +0x12
  ICSharpCode.SharpDevelop.Project.FileNode.ActivateItem() +0x42
  ICSharpCode.SharpDevelop.Gui.ExtTreeView.OnMouseDoubleClick(MouseEventArgs e) +0x22
  System.Windows.Forms.TreeView.WndProc(Message& m) +0x5a4
  Ranorex.Controls.ScrollTreeView.WndProc(Message& m) +0x0
  System.Windows.Forms.Control+ControlNativeWindow.OnMessage(Message& m) +0xc
  System.Windows.Forms.Control+ControlNativeWindow.WndProc(Message& m) +0x9a
  System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd,Int32 msg,IntPtr wparam,IntPtr lparam) +0x25
  MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) +0xffffffff
  System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) +0x40
  System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) +0x65
  System.Windows.Application.RunDispatcher(Object ignore) +0x24
  System.Windows.Application.RunInternal(Window window) +0xee
  System.Windows.Application.Run(Window window) +0x1f
  ICSharpCode.SharpDevelop.Commands.WorkbenchStartup.Run(IList`1 fileList) +0x1c6
  ICSharpCode.SharpDevelop.Sda.CallHelper.RunWorkbenchInternal(Object settings) +0x3a
  ICSharpCode.SharpDevelop.Sda.CallHelper.RunWorkbench(WorkbenchSettings settings) +0x3b
  ICSharpCode.SharpDevelop.Sda.SharpDevelopHost.RunWorkbench(WorkbenchSettings settings) +0x1e
  ICSharpCode.SharpDevelop.SharpDevelopMain.RunApplication() +0x18b
  ICSharpCode.SharpDevelop.SharpDevelopMain.Run() +0x99
  ICSharpCode.SharpDevelop.SharpDevelopMain.Main(String[] args) +0x28

---ORIGINAL STACKTRACE---
System.NullReferenceException: Object reference not set to an instance of an object.
   at ICSharpCode.SharpDevelop.Gui.AvalonDockLayout.get_WorkbenchWindows()
   at ICSharpCode.SharpDevelop.Gui.WpfWorkbench.get_WorkbenchWindowCollection()
   at ICSharpCode.SharpDevelop.Gui.WpfWorkbench.<>c__DisplayClass55_0.<get_ViewContentCollection>b__0()   at ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.STAThreadCaller.Call(WaitHandle cancelWaitHandle, Delegate method, Object[] arguments, Int32 skipFrams)
   at ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.STAThreadCaller.Call(Delegate method, Object[] arguments)
   at ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.SafeThreadCall(Action method)
   at ICSharpCode.SharpDevelop.Gui.WpfWorkbench.get_ViewContentCollection()
   at ICSharpCode.SharpDevelop.FileService.GetOpenFile(String fileName, Type viewContentType)
   at ICSharpCode.SharpDevelop.FileService.OpenFile(String fileName, Boolean switchToOpenedView, FileOperationResult& fileResult)
   at ICSharpCode.SharpDevelop.Project.FileNode.ActivateItem()
   at ICSharpCode.SharpDevelop.Gui.ExtTreeView.OnMouseDoubleClick(MouseEventArgs e)
   at System.Windows.Forms.TreeView.WndProc(Message& m)
   at Ranorex.Controls.ScrollTreeView.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)


User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7062
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: The "Unexpected exception encountered" window is displayed when opening any file in project

Post by odklizec » Fri Jul 23, 2021 9:47 pm

Hi,

If the exception started to appear after merging the code, then it's most probably caused by a bad merge. Have you tried to load a last working version of solution from source control of your choice (TFS, GIT, etc)?

BTW you are using an outdated and no longer supported version of Ranorex. I'm sure that this is not a cause of the problem you are facing, but anyway, you should keep the Ranorex updated with most recent version.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

ngocRose
Posts: 4
Joined: Thu Jun 24, 2021 9:24 am

Re: The "Unexpected exception encountered" window is displayed when opening any file in project

Post by ngocRose » Mon Jul 26, 2021 3:38 am

odklizec wrote:
Fri Jul 23, 2021 9:47 pm
If the exception started to appear after merging the code, then it's most probably caused by a bad merge. Have you tried to load a last working version of solution from source control of your choice (TFS, GIT, etc)?
Yes i tried and it still shows the above window. My project still works on another machine with the same version of ranorex