TFSBuild/MSBuild和项目参考与文件参考 [英] TFSBuild/MSBuild and Project Reference vs File Reference

查看:99
本文介绍了TFSBuild/MSBuild和项目参考与文件参考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个大型的VS解决方案,使用的是由TFS Build构建的项目引用,如下所示:

We Have a large VS solution using project references which is build by TFS Build like so:

Solution
- Project 1
- Project 2
- Project ...
- Project N

由于解决方案太大,我们每天都会使用一些较小的解决方案:

Because the solution is too large we have several smaller solutions which we use day to day:

SubSolution
- Project 1
- Project 19

问题是开发SubSolution的开发人员发现它不在构建中,因为找不到项目引用,因此他们将项目更改为使用文件引用.

The problem is that developers working on SubSolution find that it is not building because the project references could not be found, so they change the projects to use file references.

然后,这将继续中断TFS Build,后者无法找到这些文件引用,因为它们尚未生成(即使项目处于同一解决方案中).两种类型的引用之间是否有办法解决这场拉锯战.拆分解决方案的正确方法是什么?

This then goes on to break the TFS Build which cannot find these file references because they have not been built yet (Even though the projects are in the same solution). Is there a way around this tug of war between the two types of references. What is the correct way of splitting out your solutions?

推荐答案

无论您如何组织构建,开发人员都应了解引用的工作方式,并注意他们何时更改对其引用的引用除非它们打算对构建过程进行更改,否则不要在中检查这些更改.

Regardless of how you organise your build, developers should understand how references work, and be aware when they make changes to references that they shouldn't check those changes in unless they intended to make a change to the build process.

关于组织构建的主题-正如Dmytrol所说,项目引用应该在解决方案之间起作用(只要目标已经构建,但是无论如何文件引用也是如此).

On the subject of organising your builds - as Dmytrol says, project references should work between solutions (As long as the target is already built, however that's also the case for file references anyway).

我的建议是将您的项目分组为可行的小型解决方案,并在这些解决方案中使用项目参考.您的主要解决方案文件/版本也可以使用项目引用,但是,如果发现较小的解决方案之间的项目引用太难维护了,您可以改用文件引用,并通过项目依赖项或项目构建顺序来控制构建顺序(可在Visual Studio中访问)通过右键单击解决方案中的项目来打开Studio.

My advice would be to group your projects into small workable solutions and use project references within those solutions. Your main solution file / build can use project references too, however if you find project references between the smaller solutions too difficult to maintain you can use file references instead, and control the build order through project dependencies or the project build order (accessible within Visual Studio by right-clicking on a project in your solution).

这篇关于TFSBuild/MSBuild和项目参考与文件参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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