"Save me, oh God, from people who have no sense of humor."
— Ludlow Porch

My Visual Studio Macros

These are the visual studio macros I use on a daily basis. They are posted here for my own edification, but you are welcome to use them too.

macros.txt (7.07 kb)

There are four macros in here that I find quite useful. They are...


  • CollapseSolExplorerNodes
    Collapses all top-level solution explorer nodes. You know how sometimes you open up a large project and all nodes are open? This will snap the top-level nodes closed. I attach it to the "alt + \" chord.

  • ExpandSolExplorerNodes
    Expands all top-level solution explorer nodes. This is the opposite of the one above. I don't use it very often, but it was an easy one to write so I wrote it. I assign it to the "alt + /" chord.

  • MakeRegion
    This is my favorite. Select a block of code you'd like enclosed in a region. When this code executes, a dialog pops up and asks you for the region name. It is pre-populated by the method, class or property name but you can type in whatever you want.  When you press enter, the block is enclosed in a properly named region. I assign it to the "alt + R" chord.

  • AttachToAspNET
    You are all familiar with the chord "ctrl + shift + B" for building your solution. This macro works great assigned to the chord "ctrl + shift + D". When executed, it attaches your project to an existing w3wp.exe process (the running IIS web server). This saves a ton of time as compared to F5 debugging.