I have a project under source control using TFS and Azure DevOps.
It all works normally except for one thing: When I check in a file, I get this error message:
TF10122: The path '$/KnowledgeBuilder/V2/$tf/1/1f8c47a1-8066-42d7-b56c-c9960b0ee7ea.gz' contains a '$' at the beginning of a path component. Remove the '$' and try again.
The check-in does in fact succeed, but I get three of the above error messages each time. I can simply ignore this, but it is starting to get annoying.
It appears the folder in question is a TFS created and controlled folder. I tried deleting the folder, but that remove the Project from Source Control, so I restored them.
Is there a way to resolve this?
This occurs in VS22 on a Blazor Server Project. I have tried opening the Project in VS19, making a change, and then checking it in, and it works fine. So, it must be something specific to VS22.
CodePudding user response:
Someone, sometime, at some point, added that $tf
folder to version control. It should not be there, ever, under any circumstances -- that's the folder that TFVC uses to track local workspaces. That's why removing it messes up your workspace.
- Make sure any pending changes are committed or shelved first.
- Remove that folder from source control. Make sure the change is checked in. You might need to use a server workspace to do this so that the
$tf
folder isn't relevant. - Use
tf get
to force a re-sync of your local workspace.tf get /all /overwrite
should do the trick. If it doesn't, then just delete and recreate the workspace. - Add
$tf
to your.tfignore
file (although if memory serves, that shouldn't be strictly necessary -- I haven't worked with TFVC in a few years)