Attaching to a running Windows Forms process

For Windows Forms projects, you can start your deployed application from its executable file before starting the debugger, and then attach to the running process from the debugger. To attach to a process that is already running, select Run>Attach to .NET Process in the Project painter to open a dialog box from which you can select the process.

After you attach to the process, it starts running in the debugger and you can set breakpoints as you normally do. Select Run>Detach to detach from the process. This gives you more flexibility than simply using just-in-time (JIT) debugging.