Simplified Process Attaching – Reattach to Process in Visual Studio 2017

By | July 1, 2017

Attaching to a process during debugging, is one of the very common task. We can attach the Visual Studio debugger to a running process by navigating from Debug >  Attach to Process (Ctrl+Alt+P) and then select specific process from the Attach to Process dialog box. This could be a repetitive process during the development and debugging of your application. You may need to stop the debugging, then attach again next time with some modification in code. Visual Studio simplified this process attaching mechanism by introducing Reattach to Process.

Now, you can attach the process using Attach to Process window only once, then use the “Reattach to Process” (Shift+Alt+P) to attach it again.

 

Reattach to Process in Visual Studio 2017

Reattach to Process in Visual Studio 2017

 

The debugger will reattach by first attempting to match the previous process ID and then, if that fails, by matching to the previous process name. If no matches are found, or if there are multiple processes found with the same name, then the Attach to Process dialog box will appear so that you can select the correct process. Reference Text From  – Attach to Running Processes with the Visual Studio Debugger

Reattach To Process - Attaching Flow

Reattach To Process – Attaching the Process Flow

You can follow these simple steps to test it out.

  1. Run  your application in Visual Studio.
  2. Attach to a specific process to it for debugging.
  3. Stop the debugging.
  4. You will find “Reattach to Process“ option under Debug menu, select the option, to start your debugging which attached the previously attached process automatically.

Related Post: How to get list of attached processes in Visual Studio while debugging ?

During Debugging, you can navigate to Debug > Windows > Processes to find out which are the process currently attached.

 

List of Attached Process

List of Attached Process

Hope this helps !

 

3 thoughts on “Simplified Process Attaching – Reattach to Process in Visual Studio 2017

  1. Pingback: Dew Drop - July 3, 2017 (#2512) - Morning Dew

  2. Pingback: dailydotnettips.com Daily .NET Tips | Top Domains Info

  3. Pingback: Did you know – “Attach to Process” dialog window now has a “Process Filtering” option in Visual Studio 2017 ?

Comments are closed.