I am using the Workspace class from the Microsoft.TeamFoundation.Client namespace to get the latest code for a particular branch from a Team Foundation Server.

workspace.Get(new string[] { SelectedRelease.ServerPath }, VersionSpec.Latest,
RecursionType.Full, GetOptions.GetAll);

After I get the latest code, I build the relevant solution programmatically. The code can be found in the post here.

My question is 'how can I find out when the Workspace.Get method is complete? I can't build it until it has finished downloading. I thought about monitoring the solution folder, but I don't know which order the files are built in.

有帮助吗?

解决方案

This question may be of use to you:

Using the TFS 2010 API to subscribe to Workspace Events

其他提示

It's not asynchronous. As soon as it returns, your get has finished.

If you want to listen for completion in another thread (and use TFS's event system to do so instead of rolling your own), you can hook up a GettingEventHandler to your VersionControlClient.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top