Bryan Soltis

Director of Technology & Research

Posted on March 11, 2009

Visual Studio 2008 Custom Item Templates Not Showing Up

According to Microsoft documentation, you are supposed to be able to just drop in custom item template zip files into your template directory and VS will automatically see them and make them available.

I was working with a third party component that I wanted to integrate into to Visual Studio.  The company provided a pre-packaged Item Template zip file.  I followed their instructions and dropped it in My Documents\Visual Studio 2008\Templates\ItemTemplates\Visual C#  folder.  I then opened my web application and tried to create a new item based on that template.

However, the custom template was not listed:



As you can see, I have no custom templates listed.  I did a bit of searching and came across several sites with some things to try:
 - Run devenv /installvstemplates from the Microsoft Visual Studio 9.0\Common7\IDE folder  *This command is suppose dot reinstall all of the Visual Studio provided templates
- Run devenv /setup from the Microsoft Visual Studio 9.0\Common7\IDE  *This command is supposed to force VS to "sweep" your template folders and load  them into VS

I tried both of these methods with no success.  I even got another developer to try out the process with no luck.

I then opened up the zip file and examined the vstemplate file included.  The file had identical settings to other, working templates.  So what to do?

On a hunch, I tried creating a new project, only this time using the "Web Site" project template.  I then went to add a new item and behold was the custom template:



It seems as if custom item templates may only be compatible with certain project types in Visual Studio.

 

Comments
Gravatar
Aristotle Ford 10/19/2010 1:54:50 PM
Great Article! I am having styling issues with VS 2008 also. It seems as though my custom style sheet is not being fully applied. To make matters worse, I cannot control the position of my Divs because VS is forcing me to use its Style Builder - making my pages look slightly inconsistent *sign*. Still working on it...
Gravatar
Justin 10/19/2010 1:55:18 PM
I was having a similar problem. However, I ran across the Code Kindler's article on multi-file templates (blog.joubin.ca/.../...studio-2008-multi-file.html) and I was able to successfully create a register a multi-file web control template for Visual Studio 2008. The gist of his method is to wrap the item zip file that you described in a VSTemplate - a second ZIP file wrapping the first together with a Visual Studio Content Installer (.vscontent) file and then renamed with the extension .vsi.
Gravatar
prabhakar singh 10/19/2010 1:55:46 PM
This issue is with professional edition, try to install developer edition, may be you will get all the templates.
Gravatar
Dink 10/19/2010 1:56:09 PM
The only way I have been able to get a Linq To SQL class to show in my VisualCSharp --> Database --> SQL Server Project or Other Project Types --> Database --> Database projects was to do the following:

1. Create a bogus Web Application project
a. Remember the path to where the project folder will be created
2. Do your normal "Add New Item" routine to this project
a. You'll be selecting the Visual C# --> Data --> [WHATEVERITEMYOUWANT] from the dialog box
3. Save this project and then close the solution
4. Open your original database project
5. This time choose "Add Existing Item"
a. Browse to the web application you created and hunt down the item you added to it.
b. For Linq To SQL classes you'll want to add the *.dbml file to it.
c. Step 5b will cause it automatically load the O/R mapping designer

Also, I checked the Microsoft webstore in regards to a Developer Edition of VS 2008 and this does not exist. There is a Team System Development Edition which is roughly $2k to $5k in price. GO here to see the versions that MS sells: www.microsoft.com/.../default.mspx

I don't know if other editions automatically shows these item templates in the database project types but this work around is the cheapest for me by far!
Gravatar
bonus dei casinò virtuali 10/19/2010 1:56:48 PM
The company provided a pre-packaged Item Template zip file. I followed their instructions and dropped it in My Documents\Visual Studio 2008\Templates\ItemTemplates\Visual C# folder
Gravatar
huntsville web design 10/19/2010 1:57:19 PM
The directory structure is just a bit different. If you want to change a current template check out C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\CSharp and if you'd like to add your own as we've done in this example check out C:\Documents and Settings\ISuttle\My Documents\Visual Studio 2008\Templates (changing ISuttle of course). These are default locations which you can alter/view in Tools > Options > Projects and Solutions.
Gravatar
marbleblue.co.uk 10/26/2010 10:56:38 AM
Spot on! Was getting frustrated with the templates not showing up, but after creating a web app project, there they were. Very obvious! Cheers.
Gravatar
huntsville web design 3/10/2011 1:51:21 AM
I was having the same problem! thank you so much for your article and your help!

Want to join the conversation?  Leave a comment using the form below!



 Security code