Answered Error: This operation cannot be completed.

  • Monday, October 11, 2010 1:49 PM
     
     

    I get the following error when I try to rename a folder in VS 2008 in a solution that has been checked out from TFS 2010 server.

    "This operation cannot be completed. You are attempting to move or rename a source-controlled item where either an item of the same name already exists or the item is exclusively locked elsewhere."

    The solution is checked out from source control.  I am trying to rename a folder but it will not allow.

    Why?

    • Edited by motionpotion Monday, October 11, 2010 1:51 PM spelling mistake
    • Moved by Victor_Chen Wednesday, October 13, 2010 8:21 AM TFS version control (From:Visual Studio Source Control and SourceSafe)
    •  

All Replies

  • Wednesday, October 13, 2010 8:19 AM
     
     

    Hi Motionpotion,

     

    Thanks for your post.

    I think this issue is more relevant to TFS source control, I'm going to move it.

    Hope you can get more information there.

     

    Best Regards,

    Ziwei Chen

  • Wednesday, October 13, 2010 9:19 AM
    Moderator
     
     

    Hi motionpotion,

    Could you tell me where do you rename the file name ? in Source Control Explorer or Solution Explorer?

    Please unbind the solution and try again, for more information, you can refer to How to: Bind and Unbind Projects and Solutions.

    Hope it helps!

    Best Regards,

    Cathy Kong

  • Wednesday, October 13, 2010 9:43 AM
     
     

    Cathy Kong,

    I right-click on the folder in Solution Explorer and choose Rename from the menu.  It gives the error.

    To fix I choose "Exclude From Project" on that folder go to Windows Explorer and rename the folder there. Then add it back to my project in Solution Explorer.  This is not ideal as it takes a long time when there are lots of folders and projects in a solution.

    If I go into Source Control Explorer right-click on the folder and choose rename it gives the same error.  I created a test folder in Source Control Explorer, checked it in, then checked it out and tried renaming it - same error. 

    If I then try to delete a test folder from Source Control Explorer I get an error saying it cannot be deleted:

    TF14060: The item "" cannot be deleted. One or more children have pending changes.

    But there are no pending changes.  If I check in the "pending changes" then I can delete that test folder.

    It doesn't seem very logical the way it works.

  • Wednesday, October 13, 2010 10:03 PM
     
     

    I have the following questions:

    - does this problem happen if you have solution closed?

    - I would strongly recommend against renaming folder in Windows Explorer and adding it back to tfs. Instead rename folder in Source Control Explorer, with solution closed

    - why do you check out folder and then try renaming it, why not to just rename it?

    - you say that there are no pending changes under test folder but then you say that after you check them in delete succeeds? If you checkout folder, tfs will check out all files recursively. If this happens you cannot delete folder. If you want to delete it, don't check out anything under it.


    Michal Malecki TFS Version Control
  • Thursday, October 14, 2010 6:10 AM
    Moderator
     
     Answered

    Hi motionpotion,

    Files and folders under version control can be easily moved, renamed, and deleted from Source Control Explorer. Files and folder items can also be renamed and deleted from the command line. In order to simultaneously remove or delete multiple version-controlled files, you must use the command line. For more information, see Rename Command (Team Foundation Version Control) .

    In addition, check if you have these folders mapped in your workspace. Also, if they're already mapped, rename won't work if they're mapped as the root element.

    Hope it helps!

    Best Regards,

    Cathy Kong

  • Monday, October 18, 2010 1:32 AM
    Moderator
     
     

    Hi motionpotion,

    Is your issue solved?

    Best Regards,

    Cathy Kong

  • Tuesday, October 19, 2010 7:55 PM
     
     

    Cathy,

    Yes it is solved. It works from Source Control Explorer.  Thanks for your help.

  • Wednesday, May 09, 2012 12:24 AM
     
     

    I was trying to rename files to files that existed in TFS, but weren't being downloaded by a Get Latest Version.

    I had to manually browse the TFS repository and manually get each file... seems like a bug.