Reputation: 63378
I'm using TFS 2015 to build a C# solution. Deep within the folder structure of this solution are folders containing certain large non-code data files. I would like some builds to include these, and some builds to exclude them.
Using the TFS 2015 web interface, I set up the build that should exclude these files. I then use the Repository
tab and add the data folders to the Mappings section with a Cloak
type mapping.
However, when I then queue this build, it fails with "The item ... may not be cloaked because it does not have a mapped parent".
The top-level folder in the code repository is mapped, of course. Why is TFS complaining about this, and what can I do about it?
Upvotes: 3
Views: 7130
Reputation: 3538
Check this quick solution. Solved my problem.
http://jawedm.blogspot.com/2013/05/error-in-team-foundation-server-this.html
Check the boxlabeled, Recursive
Click the Change button -- a prompt appears, stating, "Newly mapped items will not be downloaded until you execute a get. Do you want to get $/[PARENT PATH] now?", where "[PARENT PATH]' is the path of the parent node
Upvotes: 0
Reputation: 65692
ProjectXYZ / Drop ' cannot be cloaked because it does not have a mapped parent.
Another way to get this error is if you specify a Sln file in the Map:
The correct place to specify a single Sln file is in step 1 the Process.
Upvotes: 1
Reputation: 51153
Your solution is just the accurate one for this issue. I will only add one more point which related to why.
In TFS, a cloaked path means the path is not included in recursive mapping of its parent folder. When your workstation has source code in the parent's mapped directory, and the source code has not been added to source control, the local directory is considered to be cloaked.
In simple terms, just as the error info mentioned, this is by designed, a 'Cloaked
' folder cannot be cloaked if the folder does not have a mapped parent. For more details, you could take a look at related info of cloak in MSDN Link: Optimize your workspace using explicit, implicit, cloaked, and non-recursive folder mappings
Upvotes: 2
Reputation: 63378
I don't know the why, but I do know that to fix this problem you need to just read the error message:
The item ... may not be cloaked because it does not have a mapped parent
So if you have ended up with this sort of repository structure in the failing build:
Type Server Path Local Path
Map $/Project $(build.sourcesDirectory)\Project
Cloak $/Project/Assets/Data/Data2013
Cloak $/Project/Assets/Data/Data2014
Cloak $/Project/Assets/Data/Data2015
You just need to add one more line like so:
Map $/Project/Assets/Data $(build.sourcesDirectory)\Project\Assets\Data
Now, the items you are attempting to Cloak
have a "mapped parent", and your build should succeed.
You might think that the fact that the whole repository tree is 'mapped' would be enough, but apparently not.
Upvotes: 5