View, pause, and kill threads in a running .Net application

I am working on .Net applications with multiple threads doing all kinds of things. When something goes wrong in production, I want to see which threads are working (by their managed name), and also be able to pause / kill them.

Anyway to achieve this?

VS is not always available (although this is a good option when available), and WinDbg's user interface is not for lightweight.

I looked at the window of program threads, for example, VS during debugging, but could not find a programmatic way to do this. Process.GetThreads returns very little usable data.

+4
source share
5 answers

.net, . , - , , . , .

+2

:

using System.Diagnostics;

ProcessThreadCollection threads = Process.GetCurrentProcess().Threads;

Thread.Abort(). , , ( ) Thread.Interrupt().

+3

/ WinDbg SOS, - .

0

ProcessExplorer id .

http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

Use the stream tab of the properties window.

You can also kill threads and view the thread stack

0
source

How about remote debugging? This can be a little tricky to configure due to security and ensuring that the correct debugging symbols are present.

Configure Remote Debugging

0
source

All Articles