Team Build Agent creates a workspace using the Location parameter as a local

Can I define a Team build agent to create a workspace with the option "Location as local"?

In the Team Collection configuration → Source Control Settings → Workspace Settings, the workspace type is set to “Local” by default, but Team Build seems to ignore it when creating the workspace.

I looked at the source code of the CreateWorkspace object used in the DefaultTemplate.11.1.xaml template and it seems like I have no way to do this.

public static Workspace CreateWorkspace(VersionControlServer versionControl, string name, IEnumerable folders, string comment, IEnumerable wsSecurity) {
    ...
        if (array.Length == 0)
        {
            CreateWorkspaceParameters createWorkspaceParameters = new CreateWorkspaceParameters(name)
            {
                Comment = comment,
                Folders = (folders == null) ? new WorkingFolder[0] : folders.ToArray(),
                Location = new WorkspaceLocation?(WorkspaceLocation.Server)
            };
            workspace = versionControl.CreateWorkspace(createWorkspaceParameters);
        }
    ...
}
+4
source share

No one has answered this question yet.


All Articles