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

前端 未结 5 1303
青春惊慌失措
青春惊慌失措 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:17

    Here is a solution I was shown...

    1. Add a message box to the project you want to debug, Project B.

      MessageBox.Show("pause");

    2. Add a breakpoint some point after the message box code above, in Project B.

    3. Run the code until the message box appears. message box image

    4. Select Debug > Attach to Process

    5. In the window that appears, select the name of the project you are executing and wish to step through, Project B. Click OK.

    6. Click OK on the message box which was created by the message box code. message box image

    You should now be at the breakpoint you placed sometime after the message box code in Project B!

提交回复
热议问题