Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

CreateWorkspaceTask Task

The CreateWorkspaceTask task creates a workspace with the name and mapping file specified in the TFSBuild.proj file.

Parameter

Description

TeamFoundationServerUrl

Specifies the Team Foundation Server URL. For example, http://MyServer:8080.

BuildUri

Specifies the build URI.

BuildDirectory

Specifies the build directory.

SourcesDirectory

Specifies the solution root for directory for source files.

Name

Specifies the workspace name.

By default, the name of the workspace created by Team Foundation Build for getting sources is defined by the following expression: [String.Format("{0}_{1}_{2}", BuildAgent.ServiceHost.Name, BuildDetail.BuildDefinition.Id, LinkingUtilities.DecodeUri(BuildAgent.Uri.AbsoluteUri).ToolSpecificId)].

Override the WorkspaceName property in TFSBuild.proj file to use a customized workspace name.

NoteNote
WorkspaceName property is also used to generate the VersionToLabel property. Therefore, if you programmatically override WorkspaceName, be sure to override VersionToLabel as well.

Comment

By default, the comment used for the workspace created by Team Foundation Build is "Workspace created by Team Build."

Override the CreateWorkspaceTaskComment property in TFSBuild.proj file to specify a different comment.

Name

String output parameter. This specifies the value of the property WorkspaceName.

Owner

String output parameter. This specifies the value of the property WorkspaceOwner.

The CreateWorkspaceTask task is defined in the Microsoft.TeamFoundation.Build.Tasks.VersionControl.dll. The Microsoft.TeamFoundation.Build.targets file contains an instance of the CreateWorkspaceTask task that Team Foundation Build uses as a default implementation for the InitializeWorkspace target.

The <root>:\Program Files\MSBuild\Microsoft\VisualStudio\TeamBuild folder on the Team Foundation Build computer contains the Microsoft.TeamFoundation.Build.targets file.

The following example shows the default instance of the CreateWorkspaceTask task that is defined in the Microsoft.TeamFoundation.Build.targets file.

<CreateWorkspaceTask
    TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
    BuildUri="$(BuildUri)"
    BuildDirectory="$(BuildDirectory)"
    SourcesDirectory="$(SolutionRoot)"
    Name="$(WorkspaceName)"
    Comment="$(CreateWorkspaceTaskComment)">
    <Output TaskParameter="Name" PropertyName="WorkspaceName" />
    <Output TaskParameter="Owner" PropertyName="WorkspaceOwner" />
    </CreateWorkspaceTask>
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.