I have found no way of dumping the stack on all threads in .NET. Neither a signal to be send to the process nor programatic access to all the threads. I can only get access to the current thread via Thread.CurrentThread.
Any tricks ?
If you're trying to get a stack dump while the process is already running (a la jstack), there are two methods as described here:
There is a little-known but effective tool called the Managed Stack Explorer. Although it features a basic GUI, it can effectively be a .NET equivalent of jstack if you add to the path; then it’s just a question of typing:
mse /s /p <pid>
I just found it necessary to take a production thread dump and this worked for me. Hope it helps :-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With