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

本文是小编为大家收集整理的关于Visual Studio 2008。如何安装一个项目模板的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

我使用"导出模板"向导创建了一个项目模板.我打开了XML文件,进行了几次较小的更改,然后对包装进行了重新拉紧.然后,我将项目模板检查到源控件中,以便团队中的每个人都可以访问它.

但是,对于我的一生,当我转到 add->新项目...

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

  • 工具 - >项目和解决方案列出的模板目录 - >常规
  • 这些目录的所有子文件夹(即/Visual C#/,/Visual Web Developer/etc)

,但什么都没有出现.其他人是否在之前设法将项目模板分发给他们的队友?

推荐答案

为了出现VS项目模板,您需要确保在复制包含.vstemplate和模板代码文件的.ZIP文件后,运行" devenv.exe/installvstemplates" programFiles%\ Microsoft Visual Studio 9.0 \ CONCOL7 \ IDE \ itemTemplates \ 文件夹.

我发现,将整个内容包裹到发现VS9路径,将项目/项目模板复制到必要的文件夹中,并调用一个自定义操作的MSI很有用"/installvstemplates"开关.这样,您的同事只需要安装包装就可以启动并运行!

希望这会有所帮助.

其他推荐答案

这是我在线找到的两篇文章:

首先关于如何创建项目模板的一个:

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

第二是如何找到VS找到项目模板.

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

据我所知,您必须将自定义模板放入:

我的文档\ Visual Studio 2005 \ templates \ projectTemplates \ Lagansy \

亚当·贝伦特

本文地址:https://www.itbaoku.cn/post/1875668.html

问题描述

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?

推荐答案

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.

其他推荐答案

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