Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Save and restore code clippings in Visual Studio Toolbox

I occasionally give demos and training at my office. I have seen and used the technique where you drag code into the Visual Studio toolbox, so that you can later drag it into a code file during a demo.

My question: I would like to be able to save and later reload tabs (each tab contains a demo/tutorial of code snips), so that I can get rid of clippings that I am not using, but still get them back.

Anyone know how to do that in Visual Studio? (using VS 2012 Professional)

Note: I have seen this article that describes where they are saved: Where does Visual Studio save code blocks that are dragged on the Toolbox

However, I am looking for a way to restore the snippets without restoring my entire set of vs settings.

like image 256
JMarsch Avatar asked Oct 14 '13 19:10

JMarsch


People also ask

How do I restore my Visual Studio Toolbox?

Walkthrough. Reset the Toolbox from Visual Studio: right-click the Toolbox and click “Reset Toolbox”.

What are the controls in Toolbox?

Manage the Toolbox window and its controls You can dock, undock, and hide Toolbox by right-clicking its toolbar and selecting one of the options. If the Toolbox no longer appears as collapsed along the left side of the Visual Studio IDE, you can add it back by choosing Window > Reset Window Layout from the menu bar.

How do I add components to Toolbox in Visual Studio?

Right-click in the Toolbox, and from the pop-up menu choose Customize Toolbox, Add/Remove Items, or Choose Items (depending on the version of Visual Studio).


1 Answers

If you still have the tool box options available in VS, in theory you can export just the toolbox contents through Tools > Import and Export Settings... and import them later.

On the Import and Export Settings Wizard, choose Export..., click Next >. In the Choose Settings to Export > Which settings do you want to export? list, clear everything and then navigate to General Settings > Toolbox and select it. Then click Next > and save the file where you want.

Afterwards you should be able to restore just the Toolbox settings by using the Tools > Import and Export Settings... dialog.

Note that after I did an import I didn't see the snippet in the Toolbox, using VS 2017 V15.2, until I shut VS down and re-started it.

like image 74
raaaaaaaandy Avatar answered Sep 30 '22 17:09

raaaaaaaandy