Where does Visual Studio save code blocks that are dragged on the Toolbox
Asked Answered
N

1

13

You can drag and drop code blocks from the Codeeditor to the Toolbox of VisualStudio, but where does Visual Studio save those code blocks.

Are they globally available (for other projects) or only available in the solution/project they are dragged?

Ninetta answered 2/2, 2011 at 9:15 Comment(0)
P
16

Any code blocks that you drag to the Toolbox are stored in your Visual Studio settings file. The default path to that file is under your "My Documents" folder:

..\My Documents\Visual Studio 2010\Settings\CurrentSettings.vssettings

but of course, the exact location can be specified from the Options dialog in Visual Studio.

They are globally available for all projects in the applicable language. For example, if you create a code snippet in a C# project, it will be available for any C# projects that you create. However, it will not be available in a VB.NET project.

Also note that you can rename the individual snippets by right-clicking on them in the Toolbox, and selecting "Rename Item" from the context menu.

But there is a better and much more powerful way to manage code snippets rather than dragging them to your Toolbox. See this article on Sara Ford's blog (a great resource for tips and tricks relating to VS).

Professional answered 2/2, 2011 at 10:57 Comment(1)
For me, on Windows 10 with Visual Studio 2019, the settings were at C:\Users\{YourUserId}\AppData\Local\Microsoft\VisualStudio\{CurrentVersion}\SettingsSquilgee

© 2022 - 2024 — McMap. All rights reserved.