tom greene
tom greene

Reputation: 5449

Is it possible to programmatically debug one's own .NET process

.NET provides an API to debug programs: http://msdn.microsoft.com/en-us/library/bb397953.aspx Is it possible to debug a thread in the same process? In other words, is it possible to have the debugger and debugee in different threads in the same process?

Upvotes: 3

Views: 442

Answers (2)

Ana Betts
Ana Betts

Reputation: 74654

No, this isn't possible. If you want to do this in a strange piecewise fashion, use userdump.exe to write an image of your process to disk, then poke through it using the native debug APIs and SOS

Upvotes: 1

Erik Funkenbusch
Erik Funkenbusch

Reputation: 93424

I'm fairly certain that when you debug a process, it debugs all threads.. thus when you stopped execution of one thread, so too would your debugger stop.

The reason for this seems clear, because threads have to interact with each other, and if you don't break all threads, then your debugging becomes very difficult.

Upvotes: 2

Related Questions