Adding a Button to the Debug Toolbar in Visual Studio


Here’s how you can add a button to the Debug toolbar in VS:

Attach to a process or run a project so that your solution is in “Running” mode

image

 

I’ll attach to devenv.exe (and make sure that I have selected “Managed (v4.5, v4.0) code” as the code type that I want to attach to, otherwise some of the debugging commands won’t apply).

image

 

Find the Debug Toolbar (depending on your VS settings, this toolbar might not show up, that’s ok, you can add any button to any toolbar)

image

 

Hit the drop down arrow at the right side of the toolbar and select “Add or Remove Buttons” >> “Customize”

image

On the Customize window press “Add Command…”

image

Select the Category and Command that you are looking for then hit “OK”

image

 

Hit the “Close” button on the Customize window

image

 

The new button will now be in the toolbar

image

 

In this case, the new button is disabled, because I haven’t broke execution yet.  After hitting the “Break All” button…

image

 

…it becomes enabled

image

Comments (2)

  1. Glenn says:

    Thanks, that's helpful.

    Any chance you know of a way to add a macro that will allow quick toggling of breaking or not breaking when CLR exceptions are thrown?  That's something I constantly find myself turning on and off, and it consists of these steps:

    – Debug -> Exceptions…

    – Check/uncheck checkbox in Exceptions dialog

    – Hit OK

    Just thought I'd ask.

  2. Dave Kidder says:

    Thanks Glenn, I agree that sounds very useful.  I was thinking about this and searched today and found an extension that sounds like it does just this.  I am going to try it today.

    visualstudiogallery.msdn.microsoft.com/50091e25-9e75-40d3-9780-a05892f474de