Starting another project in the solution in Debug mode
I am working on two processes that interact with each other via named pipes. Process#1 is running in debug mode and it starts Process#2 with Process.Start("process name")
I want to run this process#2 on debug mode also, using breakpoints.
How can I do this?
I have tried using "Attach to Process" tool in V开发者_高级运维isual Studio 2008 but it's not very practical when you are in the development process. You need to start Process#2 in order to attach to it. I want Process#2 to be started directly in debug mode.
Put this line in the Main() method of the 2nd project:
System.Diagnostics.Debugger.Launch();
That brings up the just-in-time debugger prompt as soon as the 2nd process starts running. You can pick either a new or an existing instance of visual studio to debug it. Use Debug + Step Out to get back into managed code.
If you have same solution for this projects then you can use multiple start in solution properties (Solution properties->Startup Project)
Go to solution properties in VS. Opt for multiple startup project. Unless your requirement insist opening of second app from first, this should work fine.
精彩评论