Visual Studio 2010 Project Template doesn't sh

2019-05-08 04:04发布

问题:

I tried to edit a project template after exporting it from vs2010 by extracting it and after editing compressing it again. But after that it won't show up in visual studios new project dialog.

So I tried it again, without the editing. Just extract and compress again. I even used windows zip mechanisms, but still wont work. Only the exported template works fine.

I also tried what's written here: http://msdn.microsoft.com/en-us/library/ms185298.aspx to no avail.

So is there some magic incantation nobody told me about to get it to work?

回答1:

Be carefull following Step 7 in http://msdn.microsoft.com/en-us/library/ms185298.aspx.

DON'T send the whole Folder to a zip file... only the files inside!



回答2:

Actually, there's a documented way to get VS to populate the template cache folder by just deploying the zipped template to the ProjectTemplates\etc. folder:

<Path to devenv.exe> /installvstemplates

Works on every version of VS since 2005 (and possibly even earlier versions).



回答3:

There are actually two places where templates are kept. *Templates and *TemplatesCache (where * is Item or Project). You need to update the template in both places. Note, the cache has the templates extracted from the zip file in a subdirectory that has the same name as the zip.