microsoft / azure-devops-dotnet-samples

.NET/C# samples for integrating with Azure DevOps Services and Azure DevOps Server
https://docs.microsoft.com/azure/devops/integrate
MIT License
522 stars 519 forks source link

Has the ability to create a TFS Branch been removed? #261

Open chambersDon opened 5 years ago

chambersDon commented 5 years ago

I can't seem to figure out how to create a new TFS branch with the TeamFoundation libraries. These samples show how to do it with the git but not TFS.

Microsoft.TeamFoundationServer.ExtendedClient version 14.83.0 has VersionControlServer.CreateBranch and you get the VersionControlServer from the TfsTeamProjectCollection. These are gone in the current 16.143.2 version. In fact, they seem to be gone as early as 14.83.1. Strange that it's removed in such a minor version and it's not in the release notes.

Can I programmatically create a branch?

riQQ commented 5 years ago

I think they just moved it to another assembly. It's in the DLL Microsoft.TeamFoundation.VersionControl.Client for the nuget package version 15.131.1.

hibroseph commented 5 years ago

@chambersDon my team did pretty in depth research about the branch creation of a TFS branch and we were unable to do so.

There might be a possibility loading that DLL in a powershell script and running that but that still uses the CreateBranch method in the older DLL.

shayki5 commented 5 years ago

Microsoft removed this option in the new Rest API model :/ You can do it only with the old dll.