ProgressBarOverlay causes Unhandled Exception

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.
This topic is 7 years and 2 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
robert.ganshorn
Posts: 54
Last visit: Sat Nov 25, 2023 8:17 pm

ProgressBarOverlay causes Unhandled Exception

Post by robert.ganshorn »

Product, version and build: PowerShell Studio 2017 5.4.136
32 or 64 bit version of product: 64bit
Operating system: Win7
32 or 64 bit OS: 64bit
PowerShell Version: 5.1.14393.693/Desktop

I have a script that generates an unhandled exception any time I try to add a progressbaroverlay to it. I've used this control many times before without issue. Just adding and trying to run my script generates the following error:


************** Exception Text **************
System.Management.Automation.ExitException: System error.
at System.Management.Automation.Interpreter.ThrowInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
at System.Management.Automation.ScriptBlock.InvokeWithPipeImpl(Boolean createLocalScope, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Object[] args)
at System.Management.Automation.ScriptBlock.<>c__DisplayClass4.<InvokeWithPipe>b__2()
at System.Management.Automation.Runspaces.RunspaceBase.RunActionIfNoRunningPipelinesWithThreadCheck(Action action)
at System.Management.Automation.ScriptBlock.InvokeWithPipe(Boolean useLocalScope, ErrorHandlingBehavior errorHandlingBehavior, Object dollarUnder, Object input, Object scriptThis, Pipe outputPipe, InvocationInfo invocationInfo, Object[] args)
at System.Management.Automation.ScriptBlock.InvokeAsDelegateHelper(Object dollarUnder, Object dollarThis, Object[] args)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1590.0 built by: NETFXREL2
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
PWSHHelpCtrl2017V3
Assembly Version: 4.10.76.0
Win32 Version: 4.10.76.0
CodeBase: file:///C:/Program%20Files%20(x86)/Common%20Files/SAPIEN%20Debugger%202017/PWSHHelpCtrl2017V3.DLL
----------------------------------------
System.Management.Automation
Assembly Version: 3.0.0.0
Win32 Version: 6.2.9200.16481
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Management.Automation/v4.0_3.0.0.0__31bf3856ad364e35/System.Management.Automation.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1590.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1590.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
Microsoft.PowerShell.Commands.Diagnostics
Assembly Version: 3.0.0.0
Win32 Version: 6.2.9200.16398
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.PowerShell.Commands.Diagnostics/v4.0_3.0.0.0__31bf3856ad364e35/Microsoft.PowerShell.Commands.Diagnostics.dll
----------------------------------------
System.Configuration.Install
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1590.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration.Install/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.Install.dll
----------------------------------------
System.Transactions
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1590.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------
System.Runtime.Serialization
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1590.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Serialization/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1590.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Microsoft.PowerShell.Commands.Utility
Assembly Version: 3.0.0.0
Win32 Version: 6.2.9200.16398
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.PowerShell.Commands.Utility/v4.0_3.0.0.0__31bf3856ad364e35/Microsoft.PowerShell.Commands.Utility.dll
----------------------------------------
Microsoft.PowerShell.ConsoleHost
Assembly Version: 3.0.0.0
Win32 Version: 6.2.9200.16398
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.PowerShell.ConsoleHost/v4.0_3.0.0.0__31bf3856ad364e35/Microsoft.PowerShell.ConsoleHost.dll
----------------------------------------
Microsoft.PowerShell.Commands.Management
Assembly Version: 3.0.0.0
Win32 Version: 6.2.9200.16398
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.PowerShell.Commands.Management/v4.0_3.0.0.0__31bf3856ad364e35/Microsoft.PowerShell.Commands.Management.dll
----------------------------------------
Microsoft.Management.Infrastructure
Assembly Version: 1.0.0.0
Win32 Version: 6.2.9200.16398
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.Management.Infrastructure/v4.0_1.0.0.0__31bf3856ad364e35/Microsoft.Management.Infrastructure.dll
----------------------------------------
Microsoft.PowerShell.Security
Assembly Version: 3.0.0.0
Win32 Version: 6.2.9200.16398
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.PowerShell.Security/v4.0_3.0.0.0__31bf3856ad364e35/Microsoft.PowerShell.Security.dll
----------------------------------------
Microsoft.WSMan.Management
Assembly Version: 3.0.0.0
Win32 Version: 6.2.9200.16398
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.WSMan.Management/v4.0_3.0.0.0__31bf3856ad364e35/Microsoft.WSMan.Management.dll
----------------------------------------
Anonymously Hosted DynamicMethods Assembly
Assembly Version: 0.0.0.0
Win32 Version: 4.6.1590.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/mscorlib/v4.0_4.0.0.0__b77a5c561934e089/mscorlib.dll
----------------------------------------
System.Management
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1590.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Management/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Management.dll
----------------------------------------
System.DirectoryServices
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1590.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.DirectoryServices/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.DirectoryServices.dll
----------------------------------------
System.Numerics
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1590.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1590.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1590.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1590.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Data
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1636.0 built by: NETFXREL3STAGE
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
Microsoft.ActiveDirectory.Management
Assembly Version: 6.1.0.0
Win32 Version: 6.1.7601.17514
CodeBase: file:///C:/WINDOWS/assembly/GAC_64/Microsoft.ActiveDirectory.Management/6.1.0.0__31bf3856ad364e35/Microsoft.ActiveDirectory.Management.dll
----------------------------------------
System.DirectoryServices.Protocols
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1590.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.DirectoryServices.Protocols/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.DirectoryServices.Protocols.dll
----------------------------------------
System.ServiceModel
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1590.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.ServiceModel/v4.0_4.0.0.0__b77a5c561934e089/System.ServiceModel.dll
----------------------------------------
SMDiagnostics
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1590.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/SMDiagnostics/v4.0_4.0.0.0__b77a5c561934e089/SMDiagnostics.dll
----------------------------------------
System.ServiceModel.Internals
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1590.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.ServiceModel.Internals/v4.0_4.0.0.0__31bf3856ad364e35/System.ServiceModel.Internals.dll
----------------------------------------
System.IdentityModel
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1590.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.IdentityModel/v4.0_4.0.0.0__b77a5c561934e089/System.IdentityModel.dll
----------------------------------------
System.ServiceProcess
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1590.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.ServiceProcess/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.ServiceProcess.dll
----------------------------------------
System.Design
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1590.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Design/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Design.dll
----------------------------------------
1pu02tl5
Assembly Version: 0.0.0.0
Win32 Version: 4.6.1590.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
Accessibility
Assembly Version: 4.0.0.0
Win32 Version: 4.6.1590.0 built by: NETFXREL2
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
PSEventHandler
Assembly Version: 0.0.0.0
Win32 Version: 6.2.9200.16481
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Management.Automation/v4.0_3.0.0.0__31bf3856ad364e35/System.Management.Automation.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
DevinL
Posts: 1098
Last visit: Tue Jun 06, 2017 9:15 am

Re: ProgressBarOverlay causes Unhandled Exception

Post by DevinL »

Currently, I'm not able to reproduce this on my end. Are you able to upload the script that this issue occurs with?

If so, you can upload it to this topic or you can upload it at https://sapien.com/support/upload and the code will remain private.
DevinL
SAPIEN Technologies, Inc.
User avatar
robert.ganshorn
Posts: 54
Last visit: Sat Nov 25, 2023 8:17 pm

Re: ProgressBarOverlay causes Unhandled Exception

Post by robert.ganshorn »

I have uploaded the file. I didn't code the progress bar yet because I couldn't even run my script without an error on startup.
DevinL
Posts: 1098
Last visit: Tue Jun 06, 2017 9:15 am

Re: ProgressBarOverlay causes Unhandled Exception

Post by DevinL »

I've managed to reproduce this on my end and have filed an internal bug report.

Thank you for bringing this to our attention. When I have some news to share, I'll be sure to post it here.
DevinL
SAPIEN Technologies, Inc.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: ProgressBarOverlay causes Unhandled Exception

Post by davidc »

You are getting this error because you are using the exit command in a GUI environment. Instead use the form's Close event.
  1. if ($Error.count -gt 0)
  2.     {
  3.         $formBulkUserDisabler15.Close()
  4.         return
  5.     }
Related article:
http://info.sapien.com/index.php/guis/g ... ly-happens
David
SAPIEN Technologies, Inc.
This topic is 7 years and 2 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.