In my case the exception message "There is no working folder mapping for xxx." was thrown at Microsoft.TeamFoundation.VersionControl.Client.Client.GetLocalWorkspace(String localPath, Boolean throwIfNotFound) out of my own code:
var changesets = myRealTfsServer.QueryHistory( path, versionSpec, 0, RecursionType.Full, null, new ChangesetVersionSpec( 1 ), versionSpec, 2, true, true, false, false );
My solution is to use the TFS path '$/' to specify the path parameter, which is actually not as declared in this page in MSDN which says this path should be a local path.