none
PowerShell WinForm crashes and hangs RRS feed

  • Question

  • Hi,

    Just wanted to ask the question: Is there anyway for my Winform to automatically detect if it has crashed, and if so to stop itself? And does it matter if I used this script to create exe files to launch my form or not?

    I know I could probably use jobs or different runspaces to keep and eye on the form process but I can't get my head around it. Any help would be much appreciated.

    Thank you and have a good weekend :)

    • Moved by Bill_Stewart Wednesday, December 12, 2018 9:38 PM Unanswerable drive-by question
    Friday, September 7, 2018 4:20 PM

All replies

  • What is a "crash"?  Are you asking how to detect an exception? In PowerShell we have error management methods to detect exceptions and handle them

    You must be more specific.

    help about_try_catch


    \_(ツ)_/

    Friday, September 7, 2018 5:56 PM
  • Hi jrv,

    Hope you had a good weekend :)

    Honestly, I don't know what happens. Some times the GUI launches fine and then 1 times out of 100 it will just hang - meaning that no controls work and I have to go into the task manager to close it down.

    Monday, September 10, 2018 8:11 AM
  • You need to debug your code.  You are likely stuck in a loop somewhere.


    \_(ツ)_/

    Monday, September 10, 2018 8:15 AM