Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.net hang on Application.DoEvents

One of our legacy products is a Winforms application and instead of using background threads it does everything on the main UI thread. It has a constant loop running on this main thread that calls Application.DoEvents() every 20 ms. Once in a while the application just hangs at the DoEvents call. My question is how do I find out in what queued event call the code is hanging?

P.S. Does someone know of a tool that I can use to get the stack trace of every thread in a process?

Also, this is only happening at a production client and we got to get a fix out now. No possibility in installing VS at the client either.

like image 255
John K Avatar asked Feb 10 '26 16:02

John K


1 Answers

You can do that in visual studio, just attach to the process, break execution and open the threads windows.

Menu: Debug->Windows->Threads

like image 78
Albin Sunnanbo Avatar answered Feb 16 '26 23:02

Albin Sunnanbo