Error after updating to PowerShell Studio 2018

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 6 years and 1 month 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
KrisKirby
Posts: 2
Last visit: Mon Jun 18, 2018 11:09 am

Error after updating to PowerShell Studio 2018

Post by KrisKirby »

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: 5.5.148
32 or 64 bit version of product: 64 bit
Operating system: Windows 10 Version 1709 (OS Build 16299.192)
32 or 64 bit OS: 64 bit

*** Please add details and screenshots as needed below. ***
After updating my installation to v5.5.148, I started getting this error:
"Unhandled Exception: Object reference not set to an instance of an object."
PowerShellStudio2018Error.JPG
PowerShellStudio2018Error.JPG (15.68 KiB) Viewed 3198 times
Clicking on OK then pops up the ErrorLog.txt file (attached) which contains the following error message:
--------------------------------------------------
[2018.02.09 - 14:18:06] Unhandled Exception:
Object reference not set to an instance of an object.
at ..( , IToken )
at ..( , String , Int32 , Type& )
at ..(IToken )
at ..(SyntaxEditor , EditorViewMouseEventArgs )
at ActiproSoftware.SyntaxEditor.SyntaxLanguage.#JYe(SyntaxEditor #bCb, EditorViewMouseEventArgs #yhb)
at ActiproSoftware.SyntaxEditor.SyntaxEditor.#t3e(EditorViewMouseEventArgs #yhb)
at ActiproSoftware.SyntaxEditor.EditorView.OnMouseHover(MouseEventArgs e)
at ActiproSoftware.WinUICore.UIElement.#gxe(MouseEventArgs #yhb)
at ActiproSoftware.WinUICore.UIControl.OnMouseHover(EventArgs e)
at System.Windows.Forms.Control.WndProc(Message& m)
at ActiproSoftware.SyntaxEditor.SyntaxEditor.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
--------------------------------------------------


I have uninstalled all Sapien software, rebooted, downloaded the v5.5.148 x64 installer and reinstalled. But the error comes back. I haven't done extensive testing, but the error seems to happen more frequently if I try to copy/paste code from one script to another. What can I do to fix this or do I need to install a prior version?

DO NOT POST SUBSCRIPTIONS, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM
Attachments
ErrorLog.txt
(8.29 KiB) Downloaded 79 times
cody m

Re: Error after updating to PowerShell Studio 2018

Post by cody m »

We will be fixing this issue in the next service release of PSS 2018. In the mean time it appears that this issue is linked to foreach loops and how list objects are handled within primalsense. A fix for this is explicitly declaring objects within the condition of the foreach loop as seen below.

Code: Select all

 
 foreach($variable in $variables)
 #Would be changed to
 foreach($variable in [object]$variables)
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Error after updating to PowerShell Studio 2018

Post by davidc »

We don't know if this issue is related to foreach loops until we test the script. So please attach the script that is generating this error and include steps to reproduce the error.

You can either attach the script to this topic or upload it here:

https://www.sapien.com/support/upload
David
SAPIEN Technologies, Inc.
User avatar
KrisKirby
Posts: 2
Last visit: Mon Jun 18, 2018 11:09 am

Re: Error after updating to PowerShell Studio 2018

Post by KrisKirby »

Okay, I have uploaded the file for your review.

I think it is likely that my error is due to the foreach problem. It seems that the work-around code is working.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Error after updating to PowerShell Studio 2018

Post by davidc »

The issue will be resolved in the next service release. In the meantime, making the suggested change will prevent the issue from occurring.
David
SAPIEN Technologies, Inc.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Error after updating to PowerShell Studio 2018

Post by davidc »

We just released a PowerShell Studio service build (v5.5.149). Please try updating and let us know if the issue persists.
David
SAPIEN Technologies, Inc.
This topic is 6 years and 1 month 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.