TFS 2010 隐藏在构建定义文件中 - 错误

发布于 2024-11-29 10:36:02 字数 316 浏览 1 评论 0原文

我正在使用 TFS 2010,并且正在尝试测试隐藏功能。我对每个环境(dev、qa、prod)都有几乎相同的构建定义文件 - 它们唯一的不同(出于测试目的)在于我想为 dev 和 qa 隐藏一个特定目录,然后使其对 prod 有效。

我这样做了(编辑构建定义 - 工作区 - 选择目录以及它们是否处于活动状态或隐藏状态。)但是当构建定义尝试构建时出现错误(无法找到路径“CloakTest\CloakFile.txt”的一部分) 。

在此处输入图像描述

有什么想法吗?

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.

enter image description here

Thoughts?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

御守 2024-12-06 10:36:02

隐藏会导致源代码管理文件夹从您的工作区“消失”。如果您使用它来“隐藏”您的构建所需的内容,您的构建将会失败。

您正尝试在构建中使用已通过隐藏而隐藏的文件。因此,要么不要隐藏它,要么如果不需要它,请从项目/解决方案中删除该文件。

隐藏通常用于避免将不需要的文件传输到您的开发 PC 上。想象一下,您在源代码管理中有五个项目,但您只处理其中的三个 - 您可以隐藏其他两个项目,以便您的驱动器不会因您不感兴趣的项目而混乱。它还将加快“获取”操作的速度。

另一种使用隐藏的方法是,当您有几组等效文件并希望在它们之间交换时,您可以隐藏其中一个文件并将另一个文件映射到其位置。然而,这是一种不好的做法,应该避免,除非您有充分的理由这样做 - 它会在您的开发过程中引入不必要的复杂性和可避免的故障点/脆弱性,并且如果您也开始分支,事情可能会变得非常混乱)。在大多数情况下,更好的方法是将文件并排放置,并使用构建配置或某种其他形式的条件编译来使您的构建使用适当的文件。

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.

蓝海似她心 2024-12-06 10:36:02

你想达到什么目的?如果您想将一组不同的内容映射到您的产品构建的该位置,那么您将需要同时拥有斗篷和一个附加映射,该映射将备用内容组映射到源树中的同一位置。

What are you trying to achieve? If you want to map a different set of content into that location for your prod build, then you'll want to have both the cloak and an additional mapping that maps in the alternate set of content to the same location in the source tree.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文