The Best of Visual Studio 2010: How to Import and Export Breakpoints

Command:  EditorContextMenus.CodeWindow.Breakpoint.BreakpointExport; DebuggerContextMenus.BreakpointsWindow.Exportselected;
Versions:  2010
Published:  1/28/2010
Code:  vstipDebug0003

 

Ever just wanted to email someone your Breakpoints?  Maybe do a mass change to all your breakpoints at once with a text editor?  Or just save them in case you mess them up doing something else?  Well you can do it all with the Import / Export Breakpoint feature!  Here is how it works:

1. Set one or more Breakpoints in your code

 

2. Open the Breakpoint window (CTRL + ALT +B)
 

3. Notice the new "Export" button.  Pay attention as it WILL EXPORT ONLY BREAKPOINTS MATCHING THE CURRENT SEARCH CRITERIA!!  In other words, if you don't see the Breakpoint in the Breakpoint window then it WILL NOT BE EXPORTED.  Just saying.
image

 

4. When you click on the "Export" button you get the classic "Save As" dialog and notice your breakpoints are saved out as an XML file:
clip_image006

 

5. Put in some cool name and save your Breakpoints out. 

 

6. WARNING:  Don't do this next part unless you are just practicing these skills on a non-production project solution.  Delete all your Breakpoints.

 

7. Now click on the new "Import" button:
image

 

8. Choose your XML file you just exported and click "Open" then see all your Breakpoints magically re-appear!
clip_image010