Hi all,
i have winforms app, with Unhandledexception and Threadexception events.
When I close the app, click in X in form, the application dissapears, not visible, but I can see the process in taskmgr.
I check that if there are Unhandledexception, show the error and no process in taskmgr.
any suggestions and comments ??
thanks in advanced
|
| Alhambra Eidos Development Wednesday, September 30, 2009 9:33 PM |
Use the debugger. Debug + Windows + Threads. Don't get confused by the ones started by the CLR. Use Debug + Break All and check what code is running and keeping the process alive.
Hans Passant.- Marked As Answer byAland LiMSFT, ModeratorThursday, October 08, 2009 4:47 AM
-
|
| nobugz Thursday, October 01, 2009 11:28 AM |
Beware threads. They'll keep running and keep the process alive unless you set their IsBackground property to true. Of course, you'll want to make sure they shut down cleanly before you let the UI disappear.
Hans Passant. |
| nobugz Wednesday, September 30, 2009 10:52 PM |
any sample code ??
I think no threads running, but how can I detect if any threads is running ???
Thanks !!! |
| Alhambra Eidos Development Thursday, October 01, 2009 11:01 AM |
Try with code like..
Environment.Exit(0) while closing the form |
| Ganapatisb Thursday, October 01, 2009 11:11 AM |
Use the debugger. Debug + Windows + Threads. Don't get confused by the ones started by the CLR. Use Debug + Break All and check what code is running and keeping the process alive.
Hans Passant.- Marked As Answer byAland LiMSFT, ModeratorThursday, October 08, 2009 4:47 AM
-
|
| nobugz Thursday, October 01, 2009 11:28 AM |
Thanks mister,
Using Debug + Windows + Threads, and Debug + Break All , it appears severals threads !!! but I dont know how those threads starting... in my forms there is a BackgroundWorker, but I dont start threads (using Thread.Start), perhaps any component inits the threads...
how can I know what component or object starts those threads ??? any helper tool for collect this information ??
Thanks. |
| Alhambra Eidos Development Friday, October 02, 2009 6:16 AM |
Don't get confused by the ones started by the CLR.
Hans Passant. |
| nobugz Friday, October 02, 2009 7:45 AM |
Hi Alhambra,
You can use the Threads window to monitor the threads. You can press Ctrl + Alt + H to show it when debugging.
Regards, Aland Li
Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread. |
| Aland Li Friday, October 02, 2009 9:27 AM |