如何获得我的构建代理以使用外部项目引用构建解决方案? [英] How do I get my build agent to build a solution with external project references?

查看:87
本文介绍了如何获得我的构建代理以使用外部项目引用构建解决方案?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,我遇到两个TFS构建问题:

Currently I am plagued with two TFS build issues:

问题一:我有一个项目的解决方案,该项目现在在另一个解决方案中引用了另一个项目的dll产品.生成代理似乎不包含这些dll,并且生成失败.

Issue one: I have a solution with a project that now references the dll product of another project in another solution. The build agent does not seem to include these dlls and the build fails.

问题二:我有一个解决方案,该解决方案在另一个解决方案中引用了一个项目.构建代理似乎不包括外部引用的项目,并且构建失败.

Issue two: I have a solution that references the a project in another solution. The build agent does not seem to include the externally referenced project and the build fails.

我查看了复制目录"构建活动,但不知道将其填入何处或作为源值和输出值放置什么.

I have looked at the "copy directory" build activity but have no idea where to shim that in or what to put as source and output values.

推荐答案

最佳实践是使用项目引用来引用同一解决方案中的其他项目.对于解决方案外部的引用,应使用文件引用,然后检入被引用的已编译DLL.

The best practice is to use project references for referencing other projects within the same solution. For references which are external to your solution you should use file references, and then check in the compiled DLL which is being referenced.

Solution1
  \Project1  --> Project1.dll
  \Project2  --> Project2.dll

Solution2
  \ProjectA (references Project1.dll)
  \ProjectB (references Project2.dll)
  \References
      \Project1.dll -- this DLL gets checked in here and ProjectA references from here
      \Project2.dll -- this DLL gets checked in here and ProjectB references from here

ProjectA.csproj

ProjectA.csproj

<Reference Include="Project1.dll, Version=blah blah blah">
   <HintPath>..\References\Project1.dll</HintPath>
</Reference>

ProjectB.csproj

ProjectB.csproj

<Reference Include="Project2.dll, Version=blah blah blah">
   <HintPath>..\References\Project2.dll</HintPath>
</Reference>

使用这种方法,您必须构建Solution1,获取要删除的DLL,然后将其检入Solution2的References文件夹中.您可以真正了解并在解决方案1的构建中设置一些逻辑,该逻辑会自动检出Solution2 \ References文件夹,用构建中的最新DLL替换Project1和Project2 DLL,然后将其检入...使用持续集成,将启动Solution2的构建.

With this approach you have to build Solution1, get the DLLs which get dropped, and then check them into the References folder for Solution2. You can get real fancy and setup some logic in the build for Solution1 which automatically checks out the Solution2\References folder, replaces the Project1 and Project2 DLLs with the latest from the build, and then checks them in... and if you're using Continuous Integration this kicks off the build for Solution2.

这篇关于如何获得我的构建代理以使用外部项目引用构建解决方案?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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