I am using VS2015 and I try to check out files from a folder, that is included in a workspace: I have this mapping D:\tfs and I try to check out files from D:\tfs\MyProject\Subfolder1 I have added as references the Microsoft.TeamFoundation.VersionControl.Client and Microsoft.TeamFoundation.Client v12 and used to
TfsTeamProjectCollection tfs = new TfsTeamProjectCollection(new Uri(tfsServerAddress));
var versionControl = tfs.GetService<VersionControlServer>();
var workspace = versionControl.TryGetWorkspace(pathToFolder);
But it does not work, I always get ItemNotMappedException.
This is an old code that used to work with VS2010 and I assume TFS2010. What is the newer approach for this?