in

Drowning In Technical Debt

C# | ASP.NET | SharePoint | SQL | Architecture | SOA |

Scott Roycraft

Red meat is NOT bad for you. Now blue-green meat, THAT'S bad for you! ~ Tommy Smothers

Extend Visual Studio with Custom Toolbars

I determined that the three most common reasons that cause me to have to leave Visual Studio IDE is to open a VS2005 command prompt, open the Entlib Configuration Editor and to open the MMC. I decided that I would address this by creating my own Visual Studio toolbar and adding three icons to launch these external applications.

Step 1: Register the external tools with Visual Studio
Launch the Tools\External Tools dialog and add the external tools.

For the VS2005 Command Prompt I specified the following values:
 Title:  Command &Shell in Project Directory
 Command: C:\WINNT\system32\cmd.exe
 Arguments: /k "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat" x86
 Initial Directory: $(ProjectDir)


For the EntLib Configuration Editor:
 Title:  EntLib Config Editor
 Command: C:\Program Files\Microsoft Enterprise Library January 2006\bin\EntLibConfig.exe
 Arguments: <left it blank>
 Initial Directory: $(ProjectDir)

For the Computer Management Console:
 Title:  Computer Management Console
 Command: mmc.exe
 Arguments: c:\winnt\system32\compmgmt.msc
 Initial Directory: <left it blank>

NOTE: keep track of position these commands are listed in the Menu Contents listbox. In my case my VS2005 command prompt was the second in the list. Therefore it will become my External Command 2. Likewise EntLib Config Editor was External Command 3 and the MMC was External Command 4.

Step 2: Create a new toolbar
Right mouse clicking in the toolbar area and select the Customize menu item at the bottom of the context menu. On the Customize dialog click the New button and give it a meaningful name. It will create the new toolbar without any items right next to the dialog. Switch tabs to the Commands tab and then select the Tools category. In the Commands listbox scroll down to the “External Commands” commands. Click and drag the proper external command to your new toolbar (in my case that would be External Commands 2, 3 and 4).

Step 3: Customize the new toolbar items.
Your new toolbar is functional but probably doesn’t look very nice. By default the toolbar buttons display the title of the external command. While the Customize dialog is open, right click the first toolbar button to select it and to display a new context menu. Select the Default Style menu item and then you will be able to Copy, Paste, Reset, Edit or pick an toolbar image from a list. I have a hard enough time drawing a stickman let alone a nice looking icon. So I found a few nice 16x16 icons, cut them into my clipboard and then pasted them into my toolbar item. After closing the Customize dialog then position the new toolbar up next to the existing toolbars and you are all set!

Step 4: Share your external commands
If you find other helpful external commands to make development easier please share! I recently read how one guy wired in subsonic and another svn commands.

Published Apr 25 2007, 10:14 PM by sroycraft
Filed under:

Comments

No Comments
Powered by Community Server (Commercial Edition), by Telligent Systems