Morris said:
Thanks Mr. Konrad,
I beleive you offerd an acceptable resolution to the problem but I'm afraid
I don't know how to implement your idea. I run the solution under VS 2008
debugger. What excatly should I do?
If you want to debug a second process, you need a second instance of the
debugger.
Konrad suggets inserting a delay, to provide enough time to manually
start the second instance of Visual Studio. However, a) he suggests a
loop, which in fact one would normally just call Thread.Sleep() passing
an appropriate amount of time (30000 milliseconds, for example), and b)
IMHO if one is going to modify the code being debugged (and in this
situation, that's may well be necessary, depending on exactly how the
second process runs and where your breakpoints are), you should probably
instead just use the System.Diagnostics.Debugger.Break() method, which
is basically a hard-coded break-point.
Using Debugger.Break(), when the second process hits that hard-coded
breakpoint, the OS should display a "just-in-time debugging" dialog,
asking if you want to debug the process. And of course, at that point
you would answer "yes".
Pete