Microsoft 开发人员网络 > 论坛主页 > Visual Studio Debugger > debug process spawned by other process...
提出问题提出问题
 

已答复debug process spawned by other process...

  • 2009年7月1日 20:06JaedenRuiner 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    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."

答案

全部回复

  • 2009年7月3日 6:18Roahn LuoMSFT, 版主用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     

    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!
  • 2009年7月6日 14:50JaedenRuiner 用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     已答复
    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."
  • 2009年7月9日 2:40Roahn LuoMSFT, 版主用户奖牌用户奖牌用户奖牌用户奖牌用户奖牌
     
    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!