Form Designer Delete my script

I got an update few days ago,
since then when ever I change something in the form designer and save it, my script in the VSCode is cleared.

I noticed that in the Form Designer there is a TAB called Code, that loads empty.
if I am not copying my code to there it will erase it from VBCode.

please fix it.

Version 5.6.1 will fix this issue and will be available in about 15 minutes.


after new version i got another error:
before the update each package.psd1 was saved in it’s own working directory, so I could edit it and add my own vars in it - like icon, Modules i didn’t want to export, run as admin, Console (yes/no) and so on.

right now it saves the package in c:\temp directory for all my scripts.

*when trying to delete elements from the form i get an error:image


Can you let me know how you are running the packaging? Is it through the VS Code command palette?

I’m working on trying to reproduce the issue with deleting controls but haven’t hit that yet.

for the Package i hope it will explain better:

about the error when deleting controls i added a screen capture as well:

Thanks for the videos. That’s helpful. I will take a look.

I noticed that if you add an element that related to ToolsStripMenuItem

function InitializeComponent
$ToolStripMenuItem1 = (New-Object -TypeName System.Windows.Forms.ToolStripMenuItem)
$Label1 = (New-Object -TypeName System.Windows.Forms.Label)
$MenuStrip1 = (New-Object -TypeName System.Windows.Forms.MenuStrip)

what ever you insert after this element will bring an error while trying to delete it.

but, if you move the line:
$ToolStripMenuItem1 = (New-Object -TypeName System.Windows.Forms.ToolStripMenuItem)
to the end of the function (Just before the $Form1) deleting elements is working.

hope it will help.


I will take a look. This is the first I’m hearing of it. Thanks!