5

My team is creating some standard VS solution templates. We have a well-defined project structure, resources, etc. that we need to use every time we start a new project and this is the perfect solution. The basics work nicely.

However, as well as defining folder structure (etc.) it would be nice to be able to import a number of projects from VSS/TFS. We have a number of shared assemblies that will be used by all projects and it would be awesome to add a reference to these projects when creating a new project via our template. Can anyone tell me if this is possible and, if so, how it can be achieved?

4

1 回答 1

0

我认为您可能想要模板化 3 种类型的项目(这是一个词吗?)。

  1. 新解决方案
  2. 新项目添加到解决方案
  3. 新项目添加到项目

我不确定是否可以将现有项目添加到运行项目模板时创建的解决方案中。http://msdn.microsoft.com/en-us/library/ms185308.aspx展示了如何创建多个项目模板。您可能必须手动将它们添加到解决方案中,或者创建一个修改 .sln 文件的脚本来完成该部分。

向项目或项模板添加程序集引用很容易。项目模板非常简单,因为您只需要修改项目模板的 .vstemplate 文件。请参阅http://msdn.microsoft.com/en-us/library/ms171405.aspx以供参考。

从模板添加新项目时添加新的程序集引用有点困难,但也可以完成。有关更多信息,请参阅http://msdn.microsoft.com/en-us/library/ms185290.aspx

玩得开心!

于 2011-12-15T06:40:37.177 回答