.net hang on Application.DoEvents

One of our legacy products is the Winforms application, and instead of using background threads, it does everything on the main user interface thread. It has a constant loop running in this main thread that calls Application.DoEvents () every 20 ms. From time to time, the application simply freezes when calling DoEvents. My question is, how do I know when the call queue causes code to hang?

PS Does anyone know a tool that I can use to get a stack trace for each thread in a process?

In addition, this only happens on the production client, and we need to get a fix. Unable to install VS on client.

+3
source share
2 answers

I found the tool I was looking for. Windbg

It can get a stack trace for the current Windows process. However, this application requires PDB files.

0
source

You can do this in the visual studio, just join the process, cancel execution and open the thread windows.

Menu: Debug-> Windows-> Themes

+2
source

All Articles