Get Latest using TFS API
I am trying to use the TFS API to retrieve the latest code from the server within a workspace. I found this question:
Which is essentially what I want to do; however, I want to use an existing workspace, and only retrieve a certain section of the code. Is this possible?
For example (using the example given in the above question):
workspace.Get(request, GetOptions.GetAll | GetOptions.Overwrite, "$/MyFolder/MyProject");
Is something like this possible without setting up a new workspace or something?
You need to gain access to your workspace with something like this:
var vcServer = teamProjectCollection.GetService<VersionControlServer>(); Workspace myWorkspace = vcServer.GetWorkspace("workspaceName", "workspaceOwner");
Then you get latest with a
or refine what you want get by consulting this.
In order to find out about your workspace(s) details navigate in VS to
"File" > "Source Control" > "Workspaces..."