views:

987

answers:

4

I was wondering if anyone knew of a macro or keyboard shortcut or anything really that would automate Attaching to a Process within visual studio?

+5  A: 

System.Diagnostics.Debugger.Break()

"If no debugger is attached, users are asked if they want to attach a debugger. If yes, the debugger is started. If a debugger is attached, the debugger is signaled with a user breakpoint event, and the debugger suspends execution of the process just as if a debugger breakpoint had been hit."

-- http://msdn.microsoft.com/en-us/library/system.diagnostics.debugger.break.aspx

vfilby
+5  A: 

CTRL + ALT + P brings up the dialog box. Then hit the first letter of the process you want to attach to, e.g. W for w3wp.exe

Greg Beech
I just found this too... in combination with the above will give me pretty much everything I need :)
lomaxx
+1  A: 

You can just record a macro and assign a keyboard shortcut to it in the options dialog. That's what I did. I press CTRL-ALT-SHIFT-Z and it attaches to aspnet_wp.exe for me.

Strelok
A: 

The macro is described in post Attach to Process with one shortcut

Michael Freidgeim