Page 1 of 2

Unhandled Exception - Index was out of range

Posted: Fri Mar 06, 2020 7:51 am
by bjguthrie
To help you better we need some information from you.

*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***

Product, version and build: PowerShell Studio 2020; 5.7.173
32 or 64 bit version of product: 64
Operating system: Windows 10 1903
32 or 64 bit OS: 64

*** Please add details and screenshots as needed below. ***

DO NOT POST LICENSES, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM

Periodically (and often) I receive a popup with an error stating that the Index is out of range. This can be as soon as I launch PS Studio, or a minute in or two in, and then frequently there after. Here is today's error message that occurred within moments of starting a new Forms project.

[2020.03.06 - 10:43:08] Unhandled Exception:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.ArrayList.get_Item(Int32 index)
at DevExpress.XtraBars.Docking.Helpers.BaseLayoutInfo.get_Item(Int32 index)
at DevExpress.XtraBars.Docking.DockPanel.get_Item(Int32 index)
at DevExpress.XtraBars.Docking.AutoHideContainerViewInfo.CalcHitInfo(Point point)
at DevExpress.XtraBars.Docking.AutoHideContainer.GetHotLayout(Point pt)
at DevExpress.XtraBars.Docking.AutoHideContainer.OnMouseMove(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseMove(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at DevExpress.XtraBars.Docking.ZIndexControl.WndProc(Message& m)
at DevExpress.XtraBars.Docking.AutoHideContainer.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Please advise, as these are very annoying.

Re: Unhandled Exception - Index was out of range

Posted: Fri Mar 06, 2020 7:53 am
by bjguthrie
Just happened again, as I went from Script back into Designer on the MainForm.psf:

[2020.03.06 - 10:52:24] Unhandled Exception:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.ArrayList.get_Item(Int32 index)
at DevExpress.XtraBars.Docking.Helpers.BaseLayoutInfo.get_Item(Int32 index)
at DevExpress.XtraBars.Docking.DockPanel.get_Item(Int32 index)
at DevExpress.XtraBars.Docking.AutoHideContainerViewInfo.CalcHitInfo(Point point)
at DevExpress.XtraBars.Docking.AutoHideContainer.GetHotLayout(Point pt)
at DevExpress.XtraBars.Docking.AutoHideContainer.OnMouseMove(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseMove(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at DevExpress.XtraBars.Docking.ZIndexControl.WndProc(Message& m)
at DevExpress.XtraBars.Docking.AutoHideContainer.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Re: Unhandled Exception - Index was out of range

Posted: Fri Mar 06, 2020 8:02 am
by mxtrinidad
We understand your frustration! Can you please provide a screenshot when the exception happens with the exact steps when creating a new form project. Is this a single "Form Project", or a "Multi-Form Project"? Also, where are these projects been saved?

Re: Unhandled Exception - Index was out of range

Posted: Fri Mar 06, 2020 8:12 am
by bjguthrie
Launched PS Studio as Administrator
New Project > Form Project (Creates a single form project. Used to create a script application)
Named Project "TestProject"
Save location is .\Documents\SAPIEN\PowerShell Studio\Projects. Documents is redirected to OneDrive for Business
Clicked 'Create' > Empty Form > Clicked 'Open'
Deleted sample stuff from Globals.ps1
Saved
Clicked tab for MainForm.psf
... BAM ... error
error.PNG
error.PNG (15.77 KiB) Viewed 4275 times
Clicked 'OK' on the error.

ErrorLog.txt opened in Notepad
Scrolled to the bottom to get the most recent error and copied here:

[2020.03.06 - 11:09:15] Unhandled Exception:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.ArrayList.get_Item(Int32 index)
at DevExpress.XtraBars.Docking.Helpers.BaseLayoutInfo.get_Item(Int32 index)
at DevExpress.XtraBars.Docking.DockPanel.get_Item(Int32 index)
at DevExpress.XtraBars.Docking.AutoHideContainerViewInfo.CalcHitInfo(Point point)
at DevExpress.XtraBars.Docking.AutoHideContainer.GetHotLayout(Point pt)
at DevExpress.XtraBars.Docking.AutoHideContainer.OnMouseMove(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseMove(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at DevExpress.XtraBars.Docking.ZIndexControl.WndProc(Message& m)
at DevExpress.XtraBars.Docking.AutoHideContainer.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Re: Unhandled Exception - Index was out of range

Posted: Fri Mar 06, 2020 8:27 am
by mxtrinidad
I've not able to reproduce the issue. But, I got OneDrive Personal (not the Business). Can you please try to create the New Form Project on your local drive? Let us know if the behavior change.

Re: Unhandled Exception - Index was out of range

Posted: Fri Mar 06, 2020 10:06 am
by bjguthrie
Saved project to local disk and had same issue:

[2020.03.06 - 13:05:24] Unhandled Exception:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.ArrayList.get_Item(Int32 index)
at DevExpress.XtraBars.Docking.Helpers.BaseLayoutInfo.get_Item(Int32 index)
at DevExpress.XtraBars.Docking.DockPanel.get_Item(Int32 index)
at DevExpress.XtraBars.Docking.AutoHideContainerViewInfo.CalcHitInfo(Point point)
at DevExpress.XtraBars.Docking.AutoHideContainer.GetHotLayout(Point pt)
at DevExpress.XtraBars.Docking.AutoHideContainer.OnMouseMove(MouseEventArgs e)
at System.Windows.Forms.Control.WmMouseMove(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at DevExpress.XtraBars.Docking.ZIndexControl.WndProc(Message& m)
at DevExpress.XtraBars.Docking.AutoHideContainer.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Re: Unhandled Exception - Index was out of range

Posted: Fri Mar 06, 2020 11:07 am
by mxtrinidad
Thanks for providing the information.

We are currently investigating and get back to you soon.

Re: Unhandled Exception - Index was out of range

Posted: Fri Mar 06, 2020 11:12 am
by bjguthrie
Thank you - I eagerly await a response / fix / workaround!

Re: Unhandled Exception - Index was out of range

Posted: Fri Mar 06, 2020 12:34 pm
by brittneyr
Can you please upload the file named Layout.xml from the your user AppData folder (C:\Users\[User]\AppData\Roaming\SAPIEN\PowerShell Studio):
https://www.sapien.com/support/upload

Re: Unhandled Exception - Index was out of range

Posted: Fri Mar 06, 2020 12:49 pm
by bjguthrie
Complete