TFS 2010 cloaking in the build definition file - error

∥☆過路亽.° 提交于 2019-12-24 02:09:57

问题


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?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/7042876/tfs-2010-cloaking-in-the-build-definition-file-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!