Visual Studio 2008:如何安装项目模板 [英] Visual Studio 2008: How to install an item template

查看:201
本文介绍了Visual Studio 2008:如何安装项目模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用导出模板"向导创建了一个项目模板.我打开XML文件并进行了一些小的更改,然后重新压缩了该程序包.然后,我将项目模板检查到源代码管理中,以便团队中的每个人都可以根据需要访问它.

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.

但是对于我来说,当我进入 Add-> New Item 时,无法在我的模板下显示该模板.

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.

我尝试将zip文件复制到每个可能的目录中:

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

  • 工具->项目和解决方案->常规
  • 下列出的模板目录
  • 这些目录的所有子文件夹(即/Visual C#/,/Visual Web Developer/等)
  • 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?

推荐答案

要显示VS项目模板,您需要确保在复制.zip文件后运行"devenv.exe/installvstemplates"将您的.vstemplate和模板代码文件包含到%ProgramFiles%\ Microsoft Visual Studio 9.0 \ Common7 \ IDE \ ItemTemplates \<项目类型>中;文件夹.

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.

我发现将整个内容包装到一个MSI中很有用,该MSI可发现VS9路径,将Item/Project模板复制到必要的文件夹,并调用一个自定义操作,将其传递给devenv.exe,并传递"/installvstemplates"开关.这样,您的同事只需要安装该软件包,它们就可以正常运行了!

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!

希望这会有所帮助.

这篇关于Visual Studio 2008:如何安装项目模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆