This code shows you how you could interact with your team foundation server. In my case a TFS 2010.
Open a new console application in Visual Studio and add these references:
- Microsoft.TeamFoundation.Client
- Microsoft.TeamFoundation.VersionControl.Client
TeamFoundationServer tfs = new TeamFoundationServer("http://yourtfsserver:port/something");
List<string> changedFiles = new List<string>();
VersionControlServer VCServer = (VersionControlServer)tfs.GetService<VersionControlServer>();
try
{
string path = @"C:\Users\<username>\Documents\Visual Studio 2010\Projects\just the path to your solution";
VersionSpec version = VersionSpec.Latest;
int deletionId = 0;
RecursionType recursion = RecursionType.Full;
string user = @"domain\yourusername";
foreach (Changeset item in VCServer.QueryHistory(path, version, deletionId, recursion, user, null, null, Int32.MaxValue, true, false, true))
{
foreach (Change c in item.Changes)
{
// c.Item.ServerItem;
}
}
}
catch { }
Happy codingĀ ;)