List Source Control Files and Folder under a given

2020-08-01 03:23发布

I'm redesigning a control that lists the contents (files and folders) under a given TFS path. The tricky part is that I don't want to create a workspace for achieving this, as my intention is just to list the contents and display the history of a selected item. The current implementation creates a local workspace mapping in the background to achieve this, is this needed? Can I attain this without a local workspace mapping?

Thanks Joe.

标签: tfs tfs-sdk
1条回答
Emotional °昔
2楼-- · 2020-08-01 03:54

Use GetItems, which does not require a workspace. For example:

TeamFoundationServer tfs = new TeamFoundationServer("http://tfs:8080/tfs/DefaultCollection");   
VersionControlServer versionControl = tfs.GetService<VersionControlServer>();   
ItemSet items = versionControl.GetItems(tfsPath, RecursionType.Full);
查看更多
登录 后发表回答