Change the Templates That Appear in the New Project or Item Dialogs
Versions: 2008,2010
Published: 11/6/2010
Code: vstipProj0017
WARNING: Messing with the stuff mentioned here can really cause problems if you don't know what you are doing. I try to make it so you can undo these operations but use this information at your own risk. Just saying.
With all the great changes to the New Project and New Item dialogs you may be perfectly happy with the list of things that are presented. But let's say, for argument sake, you want to get rid of some of the entries. I'll use the New Project dialog (CTRL + SHIFT + N) for these examples but this can also be done with new items as well.
Assuming we want to get rid of the C# Windows Forms Control Library:
Go to C:\Program Files\Microsoft Visual Studio <version>\Common7\IDE\<Project or Item>Templates\<language>\<project category>. You will probably have to dig deeper depending on what you are after and the path may be slightly different based on Visual Studio version. In this case the actual full path on my machine to the Windows Forms Control Library zip file is "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ProjectTemplates\CSharp\Windows":
To make sure we can get this back when we want it, just move the .ZIP file to another directory that you can use to retrieve from if you need it again:
Next, close all instances of Visual Studio and then run the following command from the Visual Studio Command Prompt: "devenv.exe /installvstemplates"
While it is running it is VERY important that you let it finish. It will run devenv.exe without any interface so you should bring up the Task Manager (CTRL + ALT + DELETE) and watch the process until it disappears from the process list:
Once it is done you can start Visual Studio again then go to create a new project (CTRL + SHIFT + N) and you should see that your template is NOT in the list anymore:
Comments
Anonymous
November 06, 2010
The comment has been removedAnonymous
November 06, 2010
@Brian Yep. I just tested it and it works the major caveat being that you have to run the command prompt as administrator or it will not work. Thanks for the info. I think I will see about digging into devenv.com more in a future set of posts.Anonymous
November 09, 2010
Rather than remove items I would like to reorganize the tree: putting items I rarely or never use deep in subtrees, moving some of the many branches at a higher level in subtrees. And also the other way around: move some templates I use a lot a bit up in the tree. For instance, I never use any VB related stuff, so I would like to move that branch far away (I realize that may be hard, as that level of the tree acts different than lower levels)). I use C# a lot, but almost exclusively the project templates that are in the 'Windows' child branch, and rarely the others. On the other extreme, I almost always start new projects as a blank solution, so I would like to make that template easier accessible than the deep nesting (in a child of 'Other Project Types') it is at now. Is there any general guidance how to modify that tree? And do you have further explanation of what "/installvstemplates" does? After all, newly added templates show up fine after restarting VS without using that switch.