CreateWorkspaceTask Task
The CreateWorkspaceTask task creates a workspace with the name and mapping file specified in the TfsBuild.proj file.
Parameters
Property | Description |
---|---|
TeamFoundationServerUrl |
Specifies the Team Foundation Server URL. For example, https://MyServer:8080. |
MappingFile |
Specifies the workspace mapping file that contains a list of server folders that maps to locations listed in the LocalPath property. |
LocalPath |
Specifies the location on disk to which all server paths that are specified by the MappingFile property will be mapped. |
Name |
Specifies the workspace name. |
TeamProject |
Specifies the team project name. |
Remarks
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. You can also customize the build process by defining a different instance of the CreateWorkspaceTask task for a build type in the TfsBuild.proj file. For more information about how to customize a task, see How to: Modify the Scope of Changesets and Work Items Associated With a Build Type.
Microsoft.TeamFoundation.Build.targets file is stored in the <root>:\Program Files\MSBuild\Microsoft\VisualStudio\v8.0\TeamBuild folder on the Team Foundation Build computer.
Example
The following example shows the default instance of the CreateWorkspaceTask task that is defined in the Microsoft.TeamFoundation.Build.targets file.
<CreateWorkspaceTask
TeamFoundationServerUrl="$(TeamFoundationServerUrl)"
MappingFile="$(WorkspaceMappingFile)"
LocalPath="$(SolutionRoot)"
Name="$(WorkspaceName)"
TeamProject="$(TeamProject)" />
See Also
Tasks
Walkthrough: Working with Team Foundation Source Control from Command Line
How to: Create a Workspace
How to: Cloak and Decloak Folders in a Workspace
How to: Customize Build Numbers
Reference
Concepts
Working with Source Control Workspaces
Team Foundation Build Tasks
Other Resources
Customizing Team Foundation Build
Team Foundation Build Targets, Tasks, and Properties