Visual Studio Developer Center > Visual Studio Forums > Visual Studio Debugger > debug process spawned by other process...
Ask a questionAsk a question
 

Answerdebug process spawned by other process...

  • Wednesday, July 01, 2009 8:06 PMJaedenRuiner Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I have an application which uses Process.Start() to spawn another applicaiton.  Both are my projects, but currently, I have some older versions and I'd like to debug what is happening in the "secondary" process. 
    So, I have my "update" project open in visual studio, and i set the "start external program" to myapp.exe which calls out to update.exe.  But I can't debug it.  I'm trying to find a way to have visual studio execute the MyApp.exe, and wait for the breakpoint in update.exe when myapp.exe executes the update application.  Is this possible to do?

    Thanks
    Jaeden "Sifo Dyas" al'Raec Ruiner
    "Never Trust a computer. Your brain is smarter than any micro-chip."

Answers

All Replies

  • Friday, July 03, 2009 6:18 AMRoahn LuoMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hello,

    Based on my understanding, we mainly have two projects, one of them named "MyApp.exe" and the other "update.exe". The breakpoint was set in the update.exe. In MyApp.exe, we use Process.Start() to launch the update.exe. What we want is to get the breakpoint in update.exe hit when debugging MyApp.exe in Visual Stduio. Please correct me if I'm wrong.

    If I'm correct, please try the steps below to get the breakpoint hit:
     1. set MyApp.exe as startup project and press F5 to start debugging
     2. right after the update.exe was launched, please click Tools -> Attach to process...
     3. find update.exe process and attach it to the Visual Studo Debugger
     4. get the breakpoint hit

    Will you please have a try and tell me the result?
    Thanks a lot!


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!
  • Monday, July 06, 2009 2:50 PMJaedenRuiner Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    So i basicaly have to step over the Process.Start line, and then attach the generated process to the debugger.  thanks, I'll try that

    J"SD"a'RR

    "Never Trust a computer. Your brain is smarter than any micro-chip."
  • Thursday, July 09, 2009 2:40 AMRoahn LuoMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hello,

    A few days have passed, I am eager to know if my suggestion help you, how about the result? Does the breakpoint get hit if we follow the steps above?

    Best regards,
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback, please tell us.
    Welcome to the All-In-One Code Framework!