Supporting Material:
Can you do a TFS get without needing a workspace?
Solution 1:
By-pass the TFS voodoo, get Git for TFS, and run the below.
(This would be the equivalent of "svn.exe 'export'" if you know that world.
"C:\MyProgFiles\GitTF\git-tf.cmd" clone http://MyCoolteamfoundationserver:8080/tfs/ $/MySolution/
Solution 2:
Create the workspace and map it and then "get" the code.
Here is a .bat version that you would mimic:
set __MYWORKSPACENAME=CI_TEMP_WORKSPACE
set __BASEDIRECTORYFINAL=c:\ci_build_stuff\
MD %__BASEDIRECTORYFINAL%
CD %__BASEDIRECTORYFINAL%
set __tfExe=C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\TF.exe
"%__tfExe%" workspace /new %__MYWORKSPACENAME% /collection:http://my_super_cool_teamfoundationserver:8080/tfs/my_cool_projects /noprompt
"%__tfExe%" workfold /map $/MyTFSPath %__BASEDIRECTORYFINAL%\SXA
"%__tfExe%" get %__BASEDIRECTORYFINAL%\MyTFSPath\ /recursive /noprompt
set __BASEDIRECTORYFINAL=
set __MYWORKSPACENAME=
set __tfExe=
Further thoughts:
Checkout
http://msbuildextensionpack.codeplex.com/workitem/11709
That might have some built in workspace voodoo in it, that isn't there on the changeset.
Get the source code and look around, it'll tell you what's going on.
I see this one:
http://msbuildextensionpack.codeplex.com/SourceControl/latest#Solutions/Main/TFS/TeamBuild.cs
public class TeamBuild : BaseTask
{
private const string GetLatestTaskAction = "GetLatest";
private const string QueueTaskAction = "Queue";
private const string RelatedChangesetsTaskAction = "RelatedChangesets";
private const string RelatedWorkItemsTaskAction = "RelatedWorkItems";