Search code examples
c#tfsazure-devopstfs-sdk

Rename TFS Branch Programaticly c# (TFS2017)


I'm trying to rename a branch programaticly using "PendRename" method from Microsoft.TeamFoundation.VersionControl.Client.

Moves working, so, if I use this to move everything to a new location, it works, but what I need is to rename a branch. It is possible to do this by commandline "tfs.exe rename " (even this is given me errors if I have more than one workspace mapped for the same server url. the ... could not be found in your workspace, or you do not have permission to access it.)

So, could you please help to understand why rename a branch is not working?

Thank you,


Solution

  • Thank you,

    The problem was, there are different processes that are generating workspaces to the directory, and then, he can't remove it.

    So, I solve this issue doing this steps: 1. reserve a workspace local location for my app´ 2. see if this workspace is mapped. If yes, I remove it 3. create a workspace to the previous folder in path and create the map 4. get latest 5. rename

    Thank you Andy-MSFT for your support.