使用TFS 2010进行依赖管理 [英] Dependency management with TFS 2010

查看:69
本文介绍了使用TFS 2010进行依赖管理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用TFS 2010管理依赖项的最佳方法是什么?

What is the best way to manage dependencies with TFS 2010 ?

编辑:
我想知道是否存在诸如Maven或NuGet,它可以轻松地管理TFS 2010中.dll的依赖项(外部文件或由我们的团队创建)。
但是,我们面临的问题是我们希望能够修改dll代码并实时测试它们可以工作(无需发布新程序包)。

I would like to know if there is a system such as Maven or NuGet which allows to easily manage dependencies of .dll (externals or created by our team) inside TFS 2010. However we face the problem that we want to be able to modify the code of our dll and test in real time if they work (without publishing a new package).

推荐答案

实际上,将NuGet作为预构建步骤很容易。您可以使用NuGet引用在项目的*。* proj文件中覆盖BeforeBuild目标。

It's actually pretty easy to invoke NuGet as a pre-build step. You can override the BeforeBuild target in your *.*proj file for the project with NuGet references.

<Target Name="BeforeBuild">
  <Exec Command="&quot;$(SolutionDir)Tools\nuget&quot; install &quot;$(ProjectDir)packages.config&quot; -o &quot;$(SolutionDir)Packages&quot;" Condition="'$(BuildingInsideVisualStudio)'==''" />
</Target>

如上面的代码段所示,您需要下载 NuGet命令行实用程序,将其放置在解决方案文件夹下的文件夹中,并将其放入版本控制中。请注意,您下载的可执行文件实际上是一个引导程序,您需要运行一次以下载 real 可执行文件。

As implied by the snippet above, you'll want to download the NuGet command line utility, place it in a folder beneath your solution folder, and check it into version control. Note that the executable you download is actually a bootstrapper that you'll want to run once to download the real executable.

下一步想要从项目目录中检入packages.config文件,而不是从解决方案目录下的packages文件夹中检入。请注意,我在上面的预构建步骤中包括了将$(BuildingInsideVisualStudio)设置为 not 的检查。使用TFS生成服务(或从命令行)进行构建时,这将导致在构建时下载并安装软件包。它不会影响您在Visual Studio中的NuGet体验。

Next you'll want to check in the packages.config file from your project directory, but not the packages folder beneath your solution directory. Note that I've included a check for $(BuildingInsideVisualStudio) to not be set in the pre-build step above. This will cause the packages to be downloaded and installed at build-time when building with the TFS build service (or from the command line). It won't affect your NuGet experience inside Visual Studio.

您可以搜索有关使用TFS自动创建NuGet软件包的文章-很多人都在此发表博客。两者的结合构成了非常强大的依赖性管理解决方案。现在我们只需要一个内置在TFS中的NuGet提要;)。

You can search for articles on automating the creation of NuGet packages with TFS - quite a few people have blogged about it. The combination of the two makes for a very capable dependency management solution. Now we just need a NuGet feed built into TFS ;).

这篇关于使用TFS 2010进行依赖管理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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