I want to find out the files recently checked in using C# and TFS API from TFS2010. It works fine where MS Visual studio 2010 is installed. this is developed using VS2010, .Net 3.5.
When I use this exe in system having VS2008 installed throws error as "*There is no working folder C:\TFS"*.
- This system has only 3.5 Framework.
- I copied all the files from C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\ReferenceAssemblies\v2.0 along with executable.
- C:\TFS is the actual mapping folder. Even tried inner folder as well.
any suggestion please. is there any way to get result from TFS without considering local mappings?
TeamFoundationServer tfsServer = new TeamFoundationServer("http://snchndevtfsapp:8080/tfs/defaultcollection");
WorkItemStore workItemStore = new WorkItemStore(tfsServer);
VersionControlServer vcServer = tfsServer.GetService(typeof(VersionControlServer)) as VersionControlServer;
var usersWorkspaces = vcServer.QueryWorkspaces(null, vcServer.AuthorizedUser, Environment.MachineName).ToList();
List<ChangedTFSItem> foundPastChanges = new System.Collections.Generic.List<ChangedTFSItem>();
var allPastChangesets = vcServer.QueryHistory(@"C:\TFS",
VersionSpec.Latest,
0,
RecursionType.Full,
null,
null,
null,
1000,
true,
false).Cast<Changeset>();
//.Where(x => x.Committer.Contains(Environment.UserName));
List<ChangedTFSItem> _foundPastChanges = allPastChangesets
.SelectMany(x => x.Changes)
.Where(x => x.Item.CheckinDate.Date >= ((DateTime)dateEdit1.EditValue))
//.DistinctBy(x => x.Item.ServerItem, x => x.Item.ServerItem.GetHashCode())
.Select(x => new ChangedTFSItem()
{
FileName = Path.GetFileName(x.Item.ServerItem),
ServerItem = usersWorkspaces[0].GetLocalItemForServerItem(x.Item.ServerItem).Replace(textEdit1.Text, ""),
LocalPath = usersWorkspaces[0].GetLocalItemForServerItem(x.Item.ServerItem),
ChangeTypeName = x.ChangeType.ToString(),
ChangeDate = x.Item.CheckinDate.ToString()
}).ToList();