Don’t you have dream to push on one shortcut only to attach to the w3wp process without accept all the dialog boxes?
This is the equivalent of pushing on ctrl+alt+p (open attach to process window), w (go to the letter w), enter (to accept to attach).
Here is the method to do that with only one key combination:
- Click on “View” – “Other windows” – “Macro Explorer” (or alt+F8)
- Right click on “MyMacros” – “New Module”
- Name it “MyCustomMacros” for example and click on “Add”
- Replace the content of the file by:
Imports System Imports EnvDTE Imports EnvDTE80 Imports EnvDTE90 Imports EnvDTE90a Imports EnvDTE100 Imports System.Diagnostics Public Module MyCustomMacros ' This subroutine attaches to calc.exe if it is running. Sub AttachToW3WP() Dim attached As Boolean = False Dim proc As EnvDTE.Process For Each proc In DTE.Debugger.LocalProcesses If (Right(proc.Name, 8) = "w3wp.exe") Then proc.Attach() attached = True 'Exit For End If Next If attached = False Then MsgBox("Could not find w3wp") End If End Sub End Module
- Right click on the toolbar zone (on the left of “help” for example) and select the latest option: “Customize…”
- Click on the “Keyboard…” button
- In the “Show commands containing” search for “w3w” for example
- Select the new macro and in the “Press shortcut keys” box type a shortcut. Don’t forget to push on “Assign”
How do you manage when you have >1 w3wp process? I typically have multiple websites running, each in their own app pool and process.
ReplyDeleteIs there some logic/heuristic that could be used to be able to to tie a solution to a particular process?
You need to change the if to add your 'if' condition (you can test the property Username who contain the application pool user for example) and uncomment the Exit For to quit the for loop.
ReplyDeleteMakes sense, thanks, will look into this :)
ReplyDelete