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 , but just a way to do it?
However, there are some situations where you must debug the application in a different way — by attaching to its process. Attaching to the process means telling the CPU to send the instructions in the executable code to a debugger before they're executed by the CPU.
Debug from the DLL project Set breakpoints in the DLL project. Right-click the DLL project and choose Set as Startup Project. Make sure the Solutions Configuration field is set to Debug. Press F5, click the green Start arrow, or select Debug > Start Debugging.
You need to create a new Python related project(or open a Python project) in Visual Studio to debug your project which includes the . py file and python codes. Just open a single . py file is not enough to debug the project in Visual Studio, so you will see the “Start” changed to “Attach…”.
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:
Here are other Stack Overflow questions that deal with that:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With