13

I have created an Item Template using the "Export Template" wizard. I opened up the XML file and made a couple of minor changes, then rezipped the package. Then I checked the item template into source control so that everyone on the team can access it if they want.

But for the life of me I can't get the template to show up under My Templates when I go to Add->New Item.

I have tried copying the zip file into every conceivable directory:

  • The template directories listed under Tools->Projects and Solutions->General
  • All the subfolders of these directories (i.e. /Visual C#/, /Visual Web Developer/ etc)

But nothing shows up. Has anyone else managed to distribute Item Templates to their team mates before?

tshepang
  • 12,111
  • 21
  • 91
  • 136
cbp
  • 25,252
  • 29
  • 125
  • 205

2 Answers2

23

In order to have a VS item template appear, you need to make sure that you run "devenv.exe /installvstemplates" after you have copied the .zip file containing your .vstemplate and template code file into the %ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates\<Project Type> folder.

I've found that it's useful to wrap the whole thing up into an MSI that discovers the VS9 path, copies the Item/Project template to the necessary folder, and calls a custom action that shells out to devenv.exe passing the "/installvstemplates" switch. That way your colleagues just need to install the package and they are up and running!

Hope this helps.

Andy Hopper
  • 3,618
  • 1
  • 20
  • 26
2

Here are the two articles I found online:

First the one on how to create an item template:

http://msdn.microsoft.com/en-us/library/ms247113(VS.80).aspx

Second is how to get VS to locate the item template.

http://msdn.microsoft.com/en-us/library/y3kkate1(VS.80).aspx

As far as I can see you have to place your custom templates in:

My Documents\Visual Studio 2005\Templates\ProjectTemplates\Language\

Adam Berent

Adam Berent
  • 1,992
  • 19
  • 21