Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
DeleteWorkspaceTask Task

DeleteWorkspaceTask Task

The DeleteWorkspaceTask task deletes the workspace left by the previous build.




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


Specifies the workspace name.


Indicates whether local items that are specified in the workspace mappings are deleted or not. If DeleteLocalItems is set to true, the local items are deleted. If DeleteLocalItems is set to false, the local items are not deleted.

DeleteLocalItems is set to true when CleanCompilationOutpuOnly and SkipInitializeWorkspace properties are false.

DeleteLocalItems is set to false when CleanCompilationOutpuOnly and SkipInitializeWorkspace properties are true.

The DeleteWorkspaceTask task is defined in the Microsoft.TeamFoundation.Build.Tasks.VersionControl.dll. The Microsoft.TeamFoundation.Build.targets file contains an instance of the DeleteWorkspaceTask task that Team Foundation Build uses as a default implementation for the AfterGet target. You can also customize the build process by defining a different instance of the DeleteWorkspaceTask task for a build type in the TFSBuild.proj file.

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 uses the DeleteWorkspaceTask task in the TFSBuild.proj file to delete the specified workspace.

<!-- Add the UsingTask to the top of the TFsBuild.proj file, right after the schema definition-->
<UsingTask TaskName="Microsoft.TeamFounadtion.Build.Tasks.DeleteWorkspaceTask"
   AssemblyFile="$(TeamBuildRefPath)\Microsoft.TeamFoundation.Build.Tasks.VersionControl.dll" />
<!-- Add the following XML after the closing </ItemGroup>-->
<!-- and before the closing </Project>-->
      < DeleteWorkspaceTask

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

    Condition=" '$(CleanCompilationOutputOnly)' != 'true' " 
    DeleteLocalItems="true" />

    Condition=" '$(CleanCompilationOutputOnly)' == 'true' "
    DeleteLocalItems="false" />

Community Additions

© 2015 Microsoft