Unable to call VersionControlServer.CreateLabel successful
Hi all,
I'm trying to create new label from TFS object model but I got error when compile. Am I missing something?
Argument '2': cannot convert from 'Microsoft.TeamFoundation.VersionControl.Client.ItemSpec' to 'Microsoft.TeamFoundation.VersionControl.Client.LabelItemSpec[]'
publicvoid CreateNewLabel(){
string serverName =@"http://tfsrv:8080";string labelName = textBox_Label.Text;TeamFoundationServer tfs =TeamFoundationServerFactory.GetServer(serverName);VersionControlServer vcs = (VersionControlServer)tfs.GetService(typeof(VersionControlServer));string labelOwner = vcs.AuthenticatedUser;string labelScope =@"$/LSI/TRUNK";string labelComment ="Example label showing API usage";VersionControlLabel labelToCreate =newVersionControlLabel(vcs, labelName, labelOwner, labelScope, labelComment);ItemSpec itemSpec =newItemSpec(labelScope,RecursionType.Full);vcs.CreateLabel(labelToCreate, itemSpec,LabelChildOption.Replace);}

