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);

}

[2504 byte] By [AndyPham] at [2007-12-28]
# 1

Hi all,

I figured it out. However, currently I'm working on test server which is in the workgroup and machine workstation is in domain which fail to authenticates. Is there anyway that I could call login dialog if authenticate is failed?

Best Regards,

AndyPham at 2007-9-4 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Version Control...

Visual Studio Team System

Site Classified