Can not debug a Project started using Process.Start()

前端 未结 5 1283
青春惊慌失措
青春惊慌失措 2021-01-02 02:49

I have two C# WinForm projects in the same solution lets call them A and B. Project A starts Process B via a call like below

ProcessStartInfo psi = new Proce         


        
5条回答
  •  迷失自我
    2021-01-02 03:14

    It sounds like you want Visual Studio to automatically attach to any child processes that are created during debugging. Other debuggers like windbg have this behavior but unfortunately Visual Studio does not. There is a user voice item which is tracking this request though

    • http://connect.microsoft.com/VisualStudio/feedback/details/772727/when-a-child-process-is-spawned-debugger-does-not-attach-to-it

    Short term though the best option is to do simply break at the point the child process is spawned and manually attach the debugger.

    var proc = Process.Start(psi);
    Debugger.Break();  
    

提交回复
热议问题