Go to Tools -> Macro Explorer
Right click on “MyMacros” and select “New Module” and name it “RecordingModule”
Copy this code in there:
Public Module RecordingModule
Dim AspNetWp As String = “aspnet_wp.exe”
Dim W3WP As String = “w3wp.exe”
If Not (AttachToProcess(W3WP)) Then
If Not AttachToProcess(AspNetWp) Then
System.Windows.Forms.MessageBox.Show(“Can’t find web server process”)
Public Function AttachToProcess(ByVal ProcessName As String) As Boolean
Dim Processes As EnvDTE.Processes = DTE.Debugger.LocalProcesses
Dim Process As EnvDTE.Process
Dim ProcessFound As Boolean = False
For Each Process In Processes
If (Process.Name.Substring(Process.Name.LastIndexOf(“\”) + 1) = ProcessName) Then
ProcessFound = True
AttachToProcess = ProcessFound
Go to Tools -> Options -> Environment -> Keyboard
Type in AttachToAspNET and put your shortcut into “Press shortcut keys” and click assign and click ok.
I used Ctrl+Shft+` (back tick)
Now you can click this when you want to debug, but it needs to be made smarter if you have two Sitecore sites open so it knows which w3wp.exe to attach to.
Special Thanks to Mike!!!