admin管理员组

文章数量:1122826

I'm working on a MacOS machine and trying to configure a TFS workspace, to work with VS Code and a proper extension.

I may be wrong but all the extensions available requires that the workspace is already mapped to a local folder, which is the problematic part for me.

In the following both 'company' and 'www.mysite' are placeholders.

The first command I execute to create the workspace works fine:

tf workspace -new Oliviers-MacBook-Pro -collection:/

The second command I execute:

tf workfold -map ‘$/www.mysite’ /Users/oliviermatrot -collection:/ -workspace:Oliviers-MacBook-Pro

Fails with validation errors :

An input validation error occurred: TF10122: The path $/www.mysite/$RECYCLE.BIN/desktop.ini contains a $ sign at the beginning of a path component. Remove the $ sign, then try again.

I have no idea why there is a validation process triggered by this command. I found out that there is a cloack option to disable validation on the server folder but it does not work for me:

tf workfold -cloak -collection:/ -workspace:Oliviers-MacBook-Pro $/www.mysite/

An error occurred: The item $/www.mysite may not be cloaked because it does not have a mapped parent.

I am unable to find an up to date method to work with TFS on a Mac, even this resource does not work.

As an additional note, here is the link my manager sent me to be able to setup my workspace:

.mysite/_versionControl?path=%24/www.mysite/Trunk

So, why is such a validation process and how can I disable it?

EDIT : Here is the DevOps portal. No $RECYCLE.BIN directory.

I'm working on a MacOS machine and trying to configure a TFS workspace, to work with VS Code and a proper extension.

I may be wrong but all the extensions available requires that the workspace is already mapped to a local folder, which is the problematic part for me.

In the following both 'company' and 'www.mysite.com' are placeholders.

The first command I execute to create the workspace works fine:

tf workspace -new Oliviers-MacBook-Pro -collection:https://dev.azure.com/company/

The second command I execute:

tf workfold -map ‘$/www.mysite.com’ /Users/oliviermatrot -collection:https://dev.azure.com/company/ -workspace:Oliviers-MacBook-Pro

Fails with validation errors :

An input validation error occurred: TF10122: The path $/www.mysite.com/$RECYCLE.BIN/desktop.ini contains a $ sign at the beginning of a path component. Remove the $ sign, then try again.

I have no idea why there is a validation process triggered by this command. I found out that there is a cloack option to disable validation on the server folder but it does not work for me:

tf workfold -cloak -collection:https://dev.azure.com/company/ -workspace:Oliviers-MacBook-Pro $/www.mysite.com/

An error occurred: The item $/www.mysite.com may not be cloaked because it does not have a mapped parent.

I am unable to find an up to date method to work with TFS on a Mac, even this resource does not work.

As an additional note, here is the link my manager sent me to be able to setup my workspace:

https://dev.azure.com/company/www.mysite.com/_versionControl?path=%24/www.mysite.com/Trunk

So, why is such a validation process and how can I disable it?

EDIT : Here is the DevOps portal. No $RECYCLE.BIN directory.

Share Improve this question edited Nov 21, 2024 at 10:34 Olivier MATROT asked Nov 21, 2024 at 9:45 Olivier MATROTOlivier MATROT 356 bronze badges 8
  • 1 TFS Cloaking does not disable validation - it just renders those paths ignored by TFS (kinda like what .gitignore does). – Dai Commented Nov 21, 2024 at 9:49
  • Are you able to open a TFS Explorer window (either in Windows - or by browsing AzureDevOps in your browser)? If so, can you confirm that there is a TFS subdirectory named $RECYCLE.BIN? If so, that should not be there, try renaming it to remove the leading $ - or see if there's a way to escape it. – Dai Commented Nov 21, 2024 at 9:53
  • 1 ...do you have a $RECYCLE.BIN file or directory in your local filesystem? (Somewhere around /Users/oliviermatrot/www.mysite.com/$RECYCLE.BIN?) EDIT: I just realised you're mapping your macOS profile directory directly to your TFS workspace (i.e. TFS will map /Users/oliviermatrot to $/www.mysite.com - so your macOS Music and Library folders will be included in TFS - so don't do that. You need to use a new empty leaf directory, I recommend something like tf workfold -map "$/" "/Users/oliviermatrot/TFSRoot/". (also, your command-line seemed to be using pretty-quotes...) – Dai Commented Nov 21, 2024 at 10:35
  • 1 @AlvinZhao-MSFT Yes - I ended up writing an incredibly long answer, with my trademark iconoclasm about how TFS is just Microsoft's NIH take on SVN - but then had to focus on my actual day-job for a bit - I'll clean it up and post it soon. – Dai Commented Nov 22, 2024 at 1:38
  • 1 @AlvinZhao-MSFT BTW, the AzDO docs currently say that only files starting with $ are prohibited - but I checked the path validation rules in Microsoft.TeamFoundation.Common (specifically Microsoft.TeamFoundation.Common.FileSpec.CheckForIllegalDollarInPath) and it's deffo for both files and directories... – Dai Commented Nov 22, 2024 at 1:41
 |  Show 3 more comments

1 Answer 1

Reset to default 0

The second command I execute...

tf workfold -map '$/www.mysite.com' /Users/oliviermatrot - collection:https://dev.azure.com/company/ -workspace:Oliviers-MacBook-Pro

...fails with this error:

An input validation error occurred:
TF10122: The path $/www.mysite.com/$RECYCLE.BIN/desktop.ini contains a $ sign at the beginning of a path component. Remove the $ sign, then try again.

The error isn't refering to the $ at the start of the TFS path ($/ww…), but to the $RECYCLE.BIN path-component (i.e. file or folder name).

So, for context: remember that TFS is basically Microsoft-of-2005's take on SVN, (back when Ballmer was in charge and MS' Not-Invented-Here-Syndrome was in full-effect). A TFS server hosts multiple Team Projects - each of which is its own source-control repository - just like an SVN or git repository: it's a self-contained folder tree containing your versioned project files.

(An interesting thing is that SVN and TFS implement branches as though they're sibling subdirectories in the same filesystem hierarchy; whereas git branches are more like parallel universes such that two branches don't share the same filesystem space at the same time - so SVN and TFS branches are URI addressable just like any other subdirectory in a repo, whereas git branches are addressed via an entirely separate namespace - just something to think about).

So, in an on-prem TFS your "Team Project" (i.e. your project repo) itself will be addressable by a HTTPS URI, of the form https://{serverName}/{TeamProjectCollection}/{TeamProjectName}/paths/to/files/go/here. For AzureDevOps (AzDO) where it's your Organization's scope substitues. So with schemes like this it means TFS needs a way to tell what part of a path-string is the actual repository-root-relative path and what is the Team Project Collection Name, Project Name, etc - and so TFS does this with the $ character: i.e. whenever TFS sees a path starting with $/ then it knows that's the repo-root - so if it sees $ within a path, then (e.g, when handling a HTTP request operating on a TFS repo) it trims-off anything to the left of the $ - so-far, so-good.

...so because $ is reserved by TFS it means you cannot use TFS with any files or folder-names that start with the $ character.


Now, in your case, it looks like you do have a (hidden) filesystem directory, an immediate child of your macOS profile directory, named $RECYCLE.BIN (which seems to be the work of Parallels Virtualization) - normally this wouldn't be a problem because you're not meant to use your macOS (or Windows) profile directory root as the directory mapped to your source-control repos.

The solution here is to create a new empty directory that will be the new root of your mapped TFS work directories, like so:

cd ~

## `pwd` should indicate you're in "/Users/oliviermatrot"

mkdir TFSRoot

cd TFSRoot

tf workfold -map "$/" "/Users/oliviermatrot/TFSRoot/"

本文标签: tfsTeam Explorer Everywhere Command Line Client workflow map validation errorsStack Overflow