none
TF14040: The folder $/MyProject/MyFolder may not be checked out.

    Question

  • I 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
    Tuesday, December 08, 2009 10:42 AM

Answers

  • 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 2:55 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:53 AM

All replies

  • 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 2:55 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:53 AM
  • Hi 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.
    Friday, December 11, 2009 8:57 AM