如何在引用彼此二进制输出的多个解决方案上设置构建定义 [英] How to set up a build definition over multiple solutions referencing each other's binary output

查看:80
本文介绍了如何在引用彼此二进制输出的多个解决方案上设置构建定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,


我目前正在尝试在TFS 2015上为我们的应用程序设置构建定义。


由于历史原因,我们的应用程序由多个(几十个)DLL组成,每个DLL都在自己的解决方案中构建,包含一个项目定义。项目文件引用其他DLL作为文件引用。


现在使用TFS2015和Visual Studio构建模板,我可以指定通配符,以便在源代码管理中找到解决方案 - 万岁!但是,遗憾的是,文件引用无法解析为同一构建定义中其他解决方案的输出。
我想创建一个单独的解决方案,仅用于构建目的,并包括每个项目定义;但是当更改项目文件中的引用时,这将破坏库的单个解决方案,开发人员无法使用
来处理他们的项目(或者他们会再次破坏我的构建)。


有没有推荐的方法来处理这种情况?另外,旁注:我们的应用程序有多个客户特定的扩展;是否有推荐的方法来解决这个问题,例如开发人员检查客户A的一些代码,基础产品
是否构建加上客户A的扩展,但不是客户B和C的内容?



感谢您的任何建议,


Roland

解决方案

你好brischt,



感谢您在此发帖。



您可以使用项目引用来引用同一解决方案中的其他项目。例如:




您可以将所有项目放在一个文件夹中。然后构建CLassLibrary1.sln,将ClassLibrary1.dll复制到Lib文件夹。最后,将代码添加到ConsoleApplication1.csproj,如下面的代码所示:

< ItemGroup> 

<参考包含=" ClassLibrary1">

< HintPath> .. \..\lib\ClassLibrary1.dll< / HintPath>

< /参考>


<参考包含="系统" />

< Reference Include =" System.Core" />

< Reference Include =" System.Xml.Linq" />

< Reference Include =" System.Data.DataSetExtensions" />

< Reference Include =" Microsoft.CSharp" />

< Reference Include =" System.Data" />

< Reference Include =" System.Net.Http" />

< Reference Include =" System.Xml" />

< / ItemGroup>


然后当你构建ConsoleApplication1.sln时,它会找到并使用。路径中的DLL:



/ TF-Test2 / MutiSolution / Lib


你也可以参考类似的线程:


<跨度> http://stackoverflow.com/questions/17708714/how-do-i-get-my-build-agent-to-build-a-solution-with -external-project-references



< p style ="line-height:115%; margin-bottom:10pt">>>基础产品构建加上客户A的扩展。


你对构建"是什么意思" for "客户A?您可以在触发器标签中选择
持续集成,以便在办理登机手续时触发构建。



最好的问候

Limitxiao Gao


Hi,

I am currently trying to set up a build definition on TFS 2015 for our application.

For historic reasons, our application consists of multiple (dozens) of DLLs, and each DLL is built within its own solution, containing one project definition. The project file references other DLLs as file references.

Now with TFS2015 and the Visual Studio build template, I can specify wildcards for solutions to be found in source control - hooray! However, unfortunately, the file references do not get resolved to the output of other solutions in the same build definition. I thought about creating a separate solution just for build purposes and including each project definition in there; however when changing the references in a project file, that would break the single solutions of the librarys and developers would not be able to work on their project (or they would break my build again).

Is there a recommended way to deal with this situation? Also, on a side note: Our application has multiple customer-specific extensions; is there a recommended way to deal with this so that e.g. a developer checks in some code for customer A, the base product gets built plus the extensions for customer A, but not the stuff for customer B and C?

Thanks for any advice,

Roland

解决方案

Hi brischt,

Thank you for posting here.

You could use project references for referencing other projects within the same solution. For example:

You could put all the projects in one folder. Then build the CLassLibrary1.sln, copy the ClassLibrary1.dll to Lib folder.Finally, add code to the ConsoleApplication1.csproj like the following code:

<ItemGroup>

<Reference Include="ClassLibrary1">

      <HintPath>..\..\lib\ClassLibrary1.dll</HintPath>

    </Reference>

    <Reference Include="System" />

    <Reference Include="System.Core" />

    <Reference Include="System.Xml.Linq" />

    <Reference Include="System.Data.DataSetExtensions" />

    <Reference Include="Microsoft.CSharp" />

    <Reference Include="System.Data" />

    <Reference Include="System.Net.Http" />

    <Reference Include="System.Xml" />

  </ItemGroup>

Then when you build the ConsoleApplication1.sln, it will find and use the .DLL in the path:


/TF-Test2/MutiSolution/Lib

You could refer to the similar thread too:

http://stackoverflow.com/questions/17708714/how-do-i-get-my-build-agent-to-build-a-solution-with-external-project-references

>>the base product gets built plus the extensions for customer A.

What did you mean about get build "for" customer A? You could select Continuous Integration in Trigger tab, so that the build will be triggered when you check in something.

Best Regards
Limitxiao Gao


这篇关于如何在引用彼此二进制输出的多个解决方案上设置构建定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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