How do I attach a process to the debugger in Visual Studio?

前端 未结 5 1230
既然无缘
既然无缘 2020-12-08 11:36

I know I can start a process in code with Process.Start(). Is it also possible to attach the debugger to that process?

Not from code per se ,

5条回答
  •  情书的邮戳
    2020-12-08 12:09

    You can attach to a running process using Tools | Attach to Process. If it's a Web Application, you can attach to it by attaching to aspnet_wp.exe or w3wp.exe.

    To answer your question on how to attach to a process programmatically:

    • Attaching to a Process Using VS.NET Automation Model

    Here are other Stack Overflow questions that deal with that:

    • Communicating with the Visual Studio Debugger Programmatically?
    • Programmatically apply breakpoints in Visual Studio

提交回复
热议问题