Debugging two processes question/launching two debug processes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am writing a fairly complex application in c# and Visual Studio .Net 2003.
Right now I am working on a simple console application (to be launched in the
future from a service) that receives messages sent via IP from an external
device. I am also writing a simulator of that external device.

My question: How do I setup the Visual Studio so that when I start debugging
my c# application, both my message sink AND simulator are launched?

I have both applications setup as projects within a single solution, and
have been manually launching both via the right mouse button menu and the
debug/start new instance selections... I remember being able to do this in VS
6.0, so it just has to be possible... I just can't come up with the right
search to find how.

Thanks for your help,
Marc
 
Use

System.Diagnostic.Debugger.Break() to open an instance of Visual Studio as a
debugger.

Good Luck!

Rafael.
 
I don't completely follow your suggestion? Are you saying I need to put this
call in my code? Does it go into my simulator or server? I just remember a
project property in VS 6 that let me have it execute a different program in
addition to the current executable.

Thanks again for your help,
Marc
 
Sorry, I was busy and made a very short reply...

Yes if you put that line in your code (C# i don't know the sintax in VB.NET
however I think is the same) at the beginning or wherever you want to debug
your program.

Use the debug version of your program, at that point the program invokes a
debugger (all debuggers installed in your system AFAK). Simply choose a new
instance of Visual Studio and there you go...

A new instance of Visual Studio will popup and inmediatelly attaches to your
process using the debug information available.

Good Luck.
Rafael.
 
Debug the service by attaching to process ('Debug' -> 'Processes') and then
IIRC there's an option to debug child processes also. You could give that a
bash.
 
Back
Top