开发者

How can I create a directory in my source control using TFS 2010 SDK?

开发者 https://www.devze.com 2023-02-20 13:26 出处:网络
I want to customize the creation of a TFS project using TFS 2010 SDK. I have already create a process template and use this sample, but I want to create a specific directory tree for the new team proj

I want to customize the creation of a TFS project using TFS 2010 SDK. I have already create a process template and use this sample, but I want to create a specific directory tree for the new team project base on a XML file which describe the tree. My problem is this message; The array must contain at least one element.

Parameter name: checkinParameters.PendingChanges

I initialize the TFS, map the server folder with a local folder and create directories in both.

fooString = Array.Find<WorkingFolder>(workspace.Folders, m => m.ServerItem.Contains("$/FR_DEV"));     

Directory.CreateDirectory(ElementPath);
Directory.CreateDirectory(fooString.ServerItem + ElementTfsPath);

After that:

PendingChange[] PendingChanges = workspace.GetPendingChanges();
// Checkin the items we added
int changesetForAdd = workspace.CheckIn(PendingChanges, "Project creation.");

However, I get an error for the pending change! How can I fix this开发者_JS百科?


my problem was that i need to add the directory in the workspace not with a simple path

workspace.PendAdd(currentSubDirectory, true);
0

精彩评论

暂无评论...
验证码 换一张
取 消