4

Using TFS SDK, how can one get the latest version number of a certain file?

Right now I'm doing this:

VersionControlServer vcs = (VersionControlServer)_tfsServer.GetService(typeof(VersionControlServer));
int LatestVersion = vcs.GetItem(change.Item.ServerItem).ChangesetId; //Get Latest Version of this item

However, this approach takes too long if I have lots of files to check. (From my test, it takes about a second for each item).

Is there any other way to get the latest version number of a file (server item) from TFS?

Thanks,

Ian
  • 5,625
  • 11
  • 57
  • 93
  • Maybe it might be good to step back a bit. Why do you want this information? What are you trying to accomplish? – Bryan Jan 26 '10 at 22:07
  • We are creating a tool that will get all the changes from TFS within a certain timeframe. One of the information about the change (file) that we want to have is its latest version. – Ian Jan 28 '10 at 13:47

0 Answers0