Visual Studio Hotkey for Web Devs: Attach to W3WP
Friends keep asking for this, so here are the instructions: In VS2010 open the Tools / Macros / Macro IDE menu item Create or edit the MyMacros project Add a new Module called "AttachToProcess" Replace all the code with the following: Imports System Imports EnvDTE Imports EnvDTE80 Imports EnvDTE90 Imports EnvDTE90a Imports EnvDTE100 Imports System.Diagnostics Public Module AttachToProcess Sub IISWorkerProcess() Dim attached As Boolean = False Dim process As EnvDTE.Process For Each process In DTE.Debugger.LocalProcesses If process.Name.EndsWith("w3wp.exe") Then process.Attach() attached = True End If Next If Not attached Then MsgBox("Couldn't find w3wp.exe") End If End Sub End Module Save this macro Close the Macro IDE Right click the VS2010 menu bar Select Customize... Click Keyboard... Select Macros.MyMacros.Attach...