Crash when using class

Support for all customers who have purchased a SAPIEN PowerShell Studio product license. This forum does not offer a response time guarantee.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE 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.
User avatar
gaulet
Posts: 2
Joined: Wed Jun 29, 2016 12:37 am

Crash when using class

Post by gaulet » Sat Oct 20, 2018 2:26 pm

Hello,

I'd like to bring an issue when i try to work with class

The error happens when i try to work to put the object inside a System.Collections.Generic.List
When i move my mouse over the variable $Bouchonlist in the line $Bouchonlist = [System.Collections.Generic.List[bouchon]]::new()
or when i try to use directly the variable $Bouchonlist to access the methods.
PSS freeze and a dialog box appears with a message "Unhandled Exception: The specified method is not supported."

This work fine on ISE
unhandled Exception.PNG
unhandled Exception.PNG (4.41 KiB) Viewed 822 times
In the first case (mouse over) the error log appear with this error and i need to close the file and reopen it to work again
--------------------------------------------------
[2018.10.20 - 23:11:37] Unhandled Exception:
La méthode spécifiée n'est pas prise en charge.
à System.Reflection.Emit.TypeBuilderInstantiation.GetConstructors(BindingFlags bindingAttr)
à ‚..(Type , String , Boolean , Int32& , Int32 )
à ‚..(IToken , Int32& , Type , Int32 )
à ‚..(Int32& , Int32 )
à ‚..(IToken , Int32& , Int32 )
à ‚..(Int32& , Int32 , Boolean , Boolean )
à ‚..( , IToken )
à ‚..( , String , Int32 , Type& )
à ‚..(IToken )
à ..(SyntaxEditor , EditorViewMouseEventArgs )
à ActiproSoftware.SyntaxEditor.SyntaxLanguage.#JYe(SyntaxEditor #bCb, EditorViewMouseEventArgs #yhb)
à ActiproSoftware.SyntaxEditor.SyntaxEditor.#t3e(EditorViewMouseEventArgs #yhb)
à ActiproSoftware.SyntaxEditor.EditorView.OnMouseHover(MouseEventArgs e)
à ActiproSoftware.WinUICore.UIElement.#gxe(MouseEventArgs #yhb)
à ActiproSoftware.WinUICore.UIControl.OnMouseHover(EventArgs e)
à System.Windows.Forms.Control.WndProc(Message& m)
à ActiproSoftware.SyntaxEditor.SyntaxEditor.WndProc(Message& m)
à System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

On the second case (when i try to use directly the variable) the error log appear with this error and if i wait some time PSS seems ok and i can work again.
--------------------------------------------------
[2018.10.20 - 23:15:06] Unhandled Exception:
La méthode spécifiée n'est pas prise en charge.
à System.Reflection.Emit.TypeBuilderInstantiation.GetConstructors(BindingFlags bindingAttr)
à ‚..(Type , String , Boolean , Int32& , Int32 )
à ‚..(IToken , Int32& , Type , Int32 )
à ‚..(Int32& , Int32 )
à ‚..(IToken , Int32& , Int32 )
à ‚..(Int32& , Int32 , Boolean , Boolean )
à ‚..( , IToken )
à ‚..( , String , Int32 , Type& )
à ‚..(IToken )
à ‚..(Int32 , IToken , String& )
à ‚..(Int32 , IToken , String& , Object& )
à ..(SyntaxEditor , Int32 )
à ..(SyntaxEditor , KeyTypedEventArgs )
à ActiproSoftware.SyntaxEditor.SyntaxEditor.#h3e(EditorView #N5b, Keys #oVe, Char #2Ne, Boolean #5Pe)
à ActiproSoftware.SyntaxEditor.SyntaxEditor.OnKeyPress(KeyPressEventArgs e)
à System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
à System.Windows.Forms.Control.WmKeyChar(Message& m)
à System.Windows.Forms.Control.WndProc(Message& m)
à ActiproSoftware.SyntaxEditor.SyntaxEditor.WndProc(Message& m)
à System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
--------------------------------------------------


  1. Class bouchon{
  2.  
  3.     [string]$name
  4.  
  5.     [int]$size
  6.  
  7.     [string]$Maker
  8.  
  9.    
  10.  
  11.     bouchon()
  12.  
  13.     {
  14.  
  15.     }
  16.  
  17.    
  18.  
  19.     [Void]Insert([String]$name, [int]$size, [string]$Maker)
  20.  
  21.     {
  22.  
  23.         $this.Name = $name
  24.  
  25.         $this.size = $size
  26.  
  27.         $this.Maker = $Maker
  28.  
  29.     }
  30.  
  31.  
  32.  
  33. }
  34.  
  35. $Bouchonlist = [System.Collections.Generic.List[bouchon]]::new()
  36.  
  37.  
  38.  
  39. $Model = [bouchon]::new()
  40.  
  41. $Model.Insert("Bouchon1", "2", "John")
Product : PowerShell Studio 2018 (64 bit)
Version : 5.5.155
OS : Windows 10 1709 (64 bit)

Thanks for the help.

User avatar
mxtrinidad
Site Admin
Posts: 224
Joined: Sun Mar 03, 2013 12:42 pm

Re: Crash when using class

Post by mxtrinidad » Sun Oct 21, 2018 1:44 pm

Thanks for reporting this issue.

We'll investigate further and get back to you as soon as possible.

User avatar
davidc
Posts: 5475
Joined: Thu Aug 18, 2011 4:56 am

Re: Crash when using class

Post by davidc » Tue Oct 23, 2018 11:27 am

The crash will be resolved in the next service release.
David
SAPIEN Technologies, Inc.

User avatar
gaulet
Posts: 2
Joined: Wed Jun 29, 2016 12:37 am

Re: Crash when using class

Post by gaulet » Wed Oct 24, 2018 1:35 pm

Thank you