- The Items to add tab says "(0)", indicating no items will be added
- All files are listed in the Exlcuded items tab
- The status message below the item tabs reads, "This item cannot be added because its destination path is cloaked"
- You are asking yourself, "What the heck is a cloaked path?"
Well, there is an easy solution for that!
About TFS Version Control Cloaked Path
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. Basically, TFS doesn't know anything about the existing code, and may be encountering naming conflicts.How to Fix the Cloaked Path Problem
The first thing to check is that your mapped folder name and path do not exceed the operating system limit. Please search Google for the maximum path and name length for your OS and version; I will not attempt to list and maintain them here.As I mentioned above, a cloaked path simply means the parent directory is not recursively mapping folders. We want to add a child folder map. These two conditions are mutually exclusive. To resolve the issue, simply change the parent map to be recursive.
Please be sure to follow the steps for your version of Visual Studio. The process has changed, over time.
Visual Studio 2013
- In the Source Control Explorer window, right click the parent node -- the context menu appears
- In Visual Studio 2012 and 2013, click the Advanced sub-menu
- Click the Remove Mapping... option in the context menu -- the Remove Mapping dialog appears
- Check the box labeled, Recursive
- Click the Change button -- the Consolidate Mappings window appears
- Click the YES 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
- Click the No button -- the prompt and Consolidate Mappings windows disappear
Visual Studio 2012
- In the Source Control Explorer window, right click the parent node -- the context menu appears
- Click the Advanced sub-menu
- Click the Remove Mapping... option in the context menu -- the Remove Mapping dialog appears
- Check the box labeled, 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
- Click the No button -- the prompt and Remove Mapping windows disappear, and then the Get window appears
- CAUTION: Use your best judgement here! I decided to click the Cancel button in the Get progress window, to prevent mapping child objects
Visual Studio 2010
- In the Source Control Explorer window, right click the parent node -- the context menu appears
- Click the Remove Mapping... option in the context menu -- the Remove Mapping dialog appears
- Check the box labeled, 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
- Click the No button -- the prompt and Remove Mapping windows disappear, and then the Get window appears
- CAUTION: Use your best judgement here! I decided to click the Cancel button in the Get progress window, to prevent mapping child objects
After following these steps, adding items should function normally. You are now the hero of the office! Bask in the glory. (Now is a good time to ask for a new software license or vacation time.)
Thank you! I want to say something snarky about Microsoft making that *so* obvious, but I'm so thrilled to have a solution I will resist. :)
ReplyDeleteTHANK YOU ;)
DeleteThanks, your solution worked for me.
ReplyDeleteThanks a lot, you made my day :-)
ReplyDeletethanks a lot, it helps :)
ReplyDeleteGreat post. Thanks a ton!
ReplyDeleteThank you, solved my problem
ReplyDeleteI also want to add my praises - thank you!
ReplyDeleteThanks a lot! really helpfull article.
ReplyDeleteThanks for the solution :)
ReplyDeleteThanks for the tip
ReplyDeletethanks a lot !
ReplyDeleteThanks a ton. It worked :)
ReplyDeleteIn 2012 the "Remove Mapping" feature is under the "Advanced" menu option
ReplyDeleteUpdate to my Update:
DeleteSteps for VS 2012 and 2013 have been added. The process changes subtly, with each generation.
Thanks man.
ReplyDeleteThis tip works - thank-you so much.
ReplyDeleteYes, many thanks. I was tearing out what little remains of my hair as it is.
ReplyDeleteWe all need a little hair tearing, to truly appreciate when tools work nicely the first time.
DeleteYou're a godsend .. thank you
ReplyDeleteThanks Mike, this post just made a tiresome morning setting up new TFS projects (there's always something new that goes wrong / I forget how to do!) slightly less annoying than it would have been. Much appreciated.
ReplyDeleteMark
Hi ,
ReplyDeleteThank you very much.. it worked for viso2013
Thank you from Stockholm.
ReplyDelete/Dan
Thank you...
ReplyDeletethank you so much !! it was very very helpful
ReplyDeleteThank you! :D
ReplyDeleteThank you for making me a hero at work :)
ReplyDeleteI got the same error message but in my case the path and file name are too long. So after renaming the file, I was able to add to the TFS successfully
ReplyDeleteAh, that is a situation I have not encountered. Good find, and thank you for reporting it.
DeleteI updated the post to include checking the path and name length.
DeleteThis comment has been removed by the author.
ReplyDeleteWorked with vs2015 after I cleaned up my own poor attempts and finally googled.. LOL and *sigh*
ReplyDeleteYou would think after all these years, MS would figure out that this is a problem THEY should address..
Either way, THANK YOU!! :)