Click here to Skip to main content
15,902,869 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

I feel really daft asking this question, but can anyone point me at some good help on using the Code Snippet Manager in Visual Studio 2012? They seem to have managed to make an easy concept infuriatingly difficult to use. I have managed to get a C# snippet to appear in the 'Code Snippets' folder, but when I try to create a snippet to go in a .aspx file, I cannot get it to go in a folder that appears in the list of available folders when I am in the source editor. And, for some reason, I am not allowed to save snippets in the ASP.NET Web Pages' folder because I don't have permission.

Arggghhh... how difficult can it be to do something so simple? There was nothing wrong with the way 2010 did it.

Rant over. Any help very much appreciated (before I pull out my remaining hair).

Kind wishes ~ Patrick
Sergey Alexandrovich Kryukov 14-Oct-13 15:24pm    
Why would you need to save snippets there? Those snippets is a part of your working environment, not related to specific application.
And can you describe the scenario of using snippets which serves you well in VS 2010 and not in VS 2012, step by step? So far, your question looks confusing to me.

Until then, please keep your hair in place for the case of worse disaster. :-)

(By the way, I have blatantly overridden snippets in the original default location created by the installation. I reasonably assumed that I would never need original installed snippets and will always use my own, and, if I even need some, I can have a backed-up versions or reinstall VS otherwise :-)
Patrick Skelton 15-Oct-13 12:28pm    

I can't remember exactly how things worked in 2010; all I do remember is having no problems.

In 2012, what I want to do is very simple. I don't want to touch availability or content of any of the existing Microsoft snippets. All I want to do is add a couple of my own. I created a directory on my development drive for the snippets because I want them to be backed up with my normal backup routine (i.e. I don't want them buried away somewhere on the C-drive). I have used the Add button in the Code Snippets Manager to add the directory where I store the snippets.

When I am in a C# file, hitting CTRL-K,X brings up a list of snippets folders. One of these is called Code Snippets, and this contains the C# snippets in my physical snippets folder on my data drive. There is also a snippets folder called My Code Snippets, which contains the .aspx snippet I created in my physical snippets folder. So, when I am in a C# file, I can get to all the snippets I have created.

When I am in a .aspx file and I hit CTRL-K,X, the drop-down list contains only the following snippets folders: ASP.NET, MVC3 & 4, and HTML. I do not get the Code Snippets or My Code Snippets folders, and my .aspx snippet does not appear anywhere.

When adding my physical snippets folder, I have tried setting the language to HTML, but this seems to have no effect.

Sorry - this is a really difficult thing to explain. All I want is to be able to place a .aspx snippet in a directory of my choice and then have this available via CTRL-K,X while editing a .aspx file. It can't be that difficult.

Kind wishes ~ Patrick

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900