Unhandled Exception - Index was out of range

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
BJGGut3
Posts: 11
Joined: Mon Apr 15, 2019 12:56 pm

Unhandled Exception - Index was out of range

Post by BJGGut3 »

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.

BJGGut3
Posts: 11
Joined: Mon Apr 15, 2019 12:56 pm

Re: Unhandled Exception - Index was out of range

Post by BJGGut3 »

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)

User avatar
mxtrinidad
Posts: 399
Joined: Sun Mar 03, 2013 12:42 pm

Re: Unhandled Exception - Index was out of range

Post 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?

BJGGut3
Posts: 11
Joined: Mon Apr 15, 2019 12:56 pm

Re: Unhandled Exception - Index was out of range

Post by BJGGut3 »

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 1384 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)

User avatar
mxtrinidad
Posts: 399
Joined: Sun Mar 03, 2013 12:42 pm

Re: Unhandled Exception - Index was out of range

Post 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.

BJGGut3
Posts: 11
Joined: Mon Apr 15, 2019 12:56 pm

Re: Unhandled Exception - Index was out of range

Post by BJGGut3 »

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)

User avatar
mxtrinidad
Posts: 399
Joined: Sun Mar 03, 2013 12:42 pm

Re: Unhandled Exception - Index was out of range

Post by mxtrinidad »

Thanks for providing the information.

We are currently investigating and get back to you soon.

BJGGut3
Posts: 11
Joined: Mon Apr 15, 2019 12:56 pm

Re: Unhandled Exception - Index was out of range

Post by BJGGut3 »

Thank you - I eagerly await a response / fix / workaround!

User avatar
brittneyr
Site Admin
Posts: 545
Joined: Thu Jun 01, 2017 7:20 am

Re: Unhandled Exception - Index was out of range

Post 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
Brittney Ryn
SAPIEN Technologies, Inc.

BJGGut3
Posts: 11
Joined: Mon Apr 15, 2019 12:56 pm

Re: Unhandled Exception - Index was out of range

Post by BJGGut3 »

Complete