- Edited by bcehr Tuesday, July 28, 2015 3:17 PM
Here is a link with others with this same issue:
http://stackoverflow.com/questions/30808084/using-windows-forms-locks-up-powershell-ise-minutes-after-script-has-terminated
- Edited by bcehr 17 hours 21 minutes ago
Here is a link with others with this same issue:
http://stackoverflow.com/questions/30808084/using-windows-forms-locks-up-powershell-ise-minutes-after-script-has-terminated
- Edited by bcehr 17 hours 14 minutes ago
Hi there.
I am building a little program to implement easier GUIs for/in Powershell as readable script.
I cant even count how many times the ISE crashed. By my experiences the crashes occured on debugging something more complicated. My motivation was not very high to find the error because it did not disturb my work too much and after a restart all scripts were reloaded and afterwards it worked for some hours again.
Though - yeah. Debugging XAML or WinForms causes often Crashes in ISE.
Oh well.
You could gather a dump of the ISE with ProcDump to see why this is crashing on your site so often. Probably we can find a hint so the ISE/error can be fixed.
The ISE is an editor. It is not really intended to be used in production. Use the CLI version of PowerShell to run WinForms.
This is an issue with debugger. All IDEs have this issue. It says you have a very subtle bug in your code. Possible a leak or something that is corrupting the Windows structures. It happens to all developers.
You need to break your script apart and test pieces until you have found the issue. If you are not experienced in design of Windows code then you will likely have serious design issues on a large project.
Remember that all event code must be cared for carefully. I have seen code where a user left a timer running which crashed to system after the Window closed.
In CLI with a script file you never would see the lockup because PowerShell shuts down before the timer ticks. In ISE the coode ends but the GUI remains. A timer tick or other late event will now lock the GUI.
Here is a link with others with this same issue:
http://stackoverflow.com/questions/30808084/using-windows-forms-locks-up-powershell-ise-minutes-after-script-has-terminated
- Edited by bcehr Monday, August 31, 2015 1:49 PM
Jrv, thanks for the reply. That was my original thought as well, but I literally went through the code and did a manual Remove-Variable for EVERY object in the code to cleanup and terminate everything and the ISE still freezes. Running Get-Variable | Remove-Variable after script execution also still results in the ISE locking up after a short time. I have also read other users having this same problem with even a simple winform application with a simple form with one control on it. Wondering if possibly could be a bug in the ISE in relation to winforms? Or there something else in my code I could be missing?
- Edited by bcehr 12 hours 29 minutes ago
Jrv, thanks for the reply. That was my original thought as well, but I literally went through the code and did a manual Remove-Variable for EVERY object in the code to cleanup and terminate everything and the ISE still freezes. Running Get-Variable | Remove-Variable after script execution also still results in the ISE locking up after a short time. I have also read other users having this same problem with even a simple winform application with a simple form with one control on it. Wondering if possibly could be a bug in the ISE in relation to winforms? Or there something else in my code I could be missing?
- Edited by bcehr 12 hours 22 minutes ago
Every case I have seen it was a coding error. If you doubt that then open a case with MS support. If they find a bug the case will be free.
I do not recommend that non-programmers build complex GUI apps with PowerShell. IF you run into a crisis you will find it very difficult to find the cause as you are seeing.
Jrv, thanks for the reply. That was my original thought as well, but I literally went through the code and did a manual Remove-Variable for EVERY object in the code to cleanup and terminate everything and the ISE still freezes. Running Get-Variable | Remove-Variable after script execution also still results in the ISE locking up after a short time. I have also read other users having this same problem with even a simple winform application with a simple form with one control on it. Wondering if possibly could be a bug in the ISE in relation to winforms? Or there something else in my code I could be missing?
- Edited by bcehr Monday, August 31, 2015 6:41 PM