问题描述
我正在使用TFS 2010,并且正在尝试测试隐藏功能。对于每个环境(dev,qa,prod),我都有几乎相同的构建定义文件-它们(仅出于测试目的)不同之处在于,我想为dev和qa掩盖特定目录,然后使其对prod处于活动状态。
我这样做了(编辑构建定义-工作区-选择目录,以及它们是否处于活动状态或隐藏。)但出现错误(找不到路径'CloakTest的一部分)
有想法吗?
隐藏会导致源控制的文件夹从您的工作区中消失。如果您使用它隐藏构建所需的内容,则构建将失败。
您正试图在构建中使用通过隐藏它而隐藏的文件。因此,要么不要伪装它,要么如果不需要它,请从您的项目/解决方案中删除该文件。
伪装通常用于避免将文件发送到开发PC上不需要的想象一下,您在源代码管理中有五个项目,但是您只能处理其中三个-您可以掩盖其他两个项目,以使驱动器不会被您不感兴趣的项目弄得乱七八糟。这还将加快获取操作。
可以使用另一种伪装方法,当您希望在多套等效文件之间进行交换时-可以伪装一个并在其位置映射另一个。但是,除非您有充分的理由这样做,否则应该避免这种不好的做法-这样做会在开发过程中引入不必要的复杂性和可避免的故障点/脆弱性,并且如果您也开始分支,事情可能会变得非常混乱)。在大多数情况下,更好的方法是将文件并排放置,并使用构建配置或某种其他形式的条件编译来使您的构建使用适当的文件。
I am using TFS 2010, and I am trying to test the cloaking functionality. I have nearly identical build definition files for each environment (dev, qa, prod) - they only differ (for testing purposes) in that I want to cloak a particular directory for dev and qa, and then make it active for prod.
I did this (edit build definition - workspace - choose directories and if they are active or cloaked.) but I get an error (Could not find a part of the path 'CloakTest\CloakFile.txt') when the build definition tries to build.
Thoughts?
Cloaking causes a source controlled folder to "disappear" from your workspace. If you use it to "hide" something your build needs, your build will fail.
You are trying to use a file in your build that has been hidden by cloaking it. So either don't cloak it, or if it's not needed, remove that file from your Project/Solution.
Cloaking is usually used to avoid getting files onto your dev PC that you don't need. Imagine you have five projects in source control but you only work on three of them - you can cloak the other two so that your drive isn't cluttered with projects you're not interested in. It will also speed up "Get" operations.
Another way cloaking can be used is when you have several sets of equivalent files that you wish to swap between - you can cloak one and map another one in its place. However, this is a bad practice that should be avoided unless you have a very strong reason for doing so - it introduces unnecessary complexity and avoidable failure-points/fragility into your development process, and things could get really messy if you start branching as well). A better approach in most circumstances is to place the files side by side and use build configurations or some other form of conditional compilation to make your build use the appropriate files.
这篇关于TFS 2010隐藏在构建定义文件中-错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!