TF14040: The folder $/MyProject/MyFolder may not be checked out.
-
Tuesday, December 08, 2009 10:42 AMI try to check out folder using:
1. command line
tf edit "$/MyProject/MyFolder"
tf checkout "$/MyProject/MyFolder"
2. c# code
private Workspace tfsWorkspace;
...
tfsWorkspace.PendEdit(@"$/MyProject/MyFolder");
In both cases I get error:
TF14040: The folder $/MyProject/MyFolder may not be checked out.
But it's all OK when I try to checkout it via Source Control Explorer.
Nobody has any activity(lock, checkout etc.) in this folder.
Folder has no subfolders.
It's all OK when I try to checkout single file from both command line and c# code.
It doesn't matter whether ReadOnly attribute is set to files in this folder
All Replies
-
Friday, December 11, 2009 2:55 AMModerator
Hi ElSh,
Thank you for your post.
1. command line
tf edit "$/MyProject/MyFolder"
tf checkout "$/MyProject/MyFolder"
I tried running this command and came across the same error message as you mentioned.
To check out one folder, could you please try the following command line?
tf checkout "%/project/folder" /recursive
For /recursive option, it helps to check out all files that match one or more files in the current directory or specified location and subfolders.
For more information on how to use Checkout commands, please refer to: http://msdn.microsoft.com/en-us/library/1yft8zkw(VS.80).aspx.
2. c# code
private Workspace tfsWorkspace;
...
tfsWorkspace.PendEdit(@"$/MyProject/MyFolder");
For coding, you might try getting all files (including files in the subfolders) in specified location and check out all these files.
Hope this helps! If you have any concern, please feel free to let me know.
Best regards,
Yichun Chen
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.- Marked As Answer by ElSh Friday, December 11, 2009 8:53 AM
-
Friday, December 11, 2009 8:53 AM
Thanks a lot. It's helpful.
In C# it's possible to write
tfsWorkspace.PendEdit(@"$/MyProject/MyFolder", RecursionType.Full);- Marked As Answer by ElSh Friday, December 11, 2009 8:53 AM
-
Friday, December 11, 2009 8:57 AMModeratorHi ElSh,
It's my pleasure! And thank you for your kindly sharing.
I'm so glad to hear that. Cheer!
Have a great weekend.
Best regards,
Yichun Chen
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.

