When I want to debug I have to do Debug->Attach to Process -> Look for a process in the list -> Attach.
I was wondering if I can create some kind of a shortcut to
More: Search the VS Marketplace for "attach"
w3wp.exe
and it'll jump to that, then Enter to attach.Current release is VS2015 at time of writing.
Go ahead and edit/extend this answer :-)
This answer should work for Visual Studio 2010.
I like having buttons to do this on my debug toolbar
https://gist.github.com/1406827
The gist contains a method for attaching to IIS (w3wp.exe) or ASP (aspnet_wp.exe) and also nunit (nunit-agent.exe). Instructions are included on how to add the macros to your debug toolbar.
For Visual Studio 2017, 2019, there is a ReAttach extension available. Very handy.
The easiest way to do this is to write a macro which finds the DTE.LocalProcess
you wan to target and automatically attach. For example
Public Sub AttachShortcut()
For Each proc In DTE.Debugger.LocalProcesses
If proc.Name = "what you're looking for" Then
proc.Attach()
Exit Sub
End IF
Next
End Sub
Note: This Stack Overflow Question is related and has a sample you may find useful
The shortcut is Ctrl+Alt+P in Visual Studio 2005 and above
.
Alt
+Shift
+P
to reattach the last attached process.
It works for me in Visual Studio 2017.