Check-in code into TFS Server by using TFS API

后端 未结 1 1636
既然无缘
既然无缘 2021-01-14 05:48

I\'m writing c# code to check-in code to TFS server:

Workspace WS = VersionControl.GetWorkspace(TeamProject);
WS.Map(TFSMapServerPath,LocalWorkingPath);

int         


        
1条回答
  •  -上瘾入骨i
    2021-01-14 05:50

    I changed the command WS.GetPendingChanges() to WS.GetPendingChanges(tfsServerFolderPath,RecursionType.Full) and it is working at my side.

    Here is detail:

            //Get the current workspace
            WS = versionControl.GetWorkspace(workspaceName, versionControl.AuthorizedUser);     
    
            //Mapping TFS Server and code generated
            WS.Map(tfsServerFolderPath,localWorkingPath);
    
            //Add all files just created to pending change
            int NumberOfChange = WS.PendAdd(localWorkingPath,true);
            //Get the list of pending changes
            PendingChange[] pendings = WS.GetPendingChanges(tfsServerFolderPath,RecursionType.Full);
    
            //Auto check in code to Server
            WS.CheckIn(pendings,"CodeSmith Generator - Auto check-in code.");
    

    0 讨论(0)
提交回复
热议问题