How to treat Microsoft Team Foundation Server workspace to allow working with ApexSQL Source Control

Applies to
ApexSQL Source Control

Summary
This article explains what to do and how to treat a Microsoft Team Foundation Server (TFS) workspace to allow working with ApexSQL Source Control and avoid common errors.

Description

A Team Foundation Server workspace contains a set of working folder mappings. These mappings represent the location of client-side folders on a local disk and the corresponding repository folders. The name of the workspace owner and the name of the computer on which the workspace is used are also stored in Team Foundation Server.

The common issue that could occur when a developer has to work on a project using its own computer, is warning message: “The path <local filepath> is already mapped in workspace <workspace name> [<project collection url>].”, as shown in the image below:

The consequence of this warning message is that ApexSQL Source Control will not be able to accomplish the commit or get latest commands, due to a conflict between the existing two owners of a single workspace.

Removing the conflicting workspace allows ApexSQL Source Control to work as expected. Workspaces can be removed using Visual Studio or Command Line Interface (CLI).

Quick tip icon

Quick tip:

To modify or delete an existing workspace, a global administrator workspace permission is required. More information about this can be found on the Microsoft web site: Team Foundation Server Permissions

To remove a Team Foundation Server workspace from Visual Studio:

  1. Connect to Team Foundation Server
  2. Start Source Control Explorer and select the Workspaces option from the drop-down menu:

Quick tip icon

Quick tip:

When removing a Team Foundation Server workspace, all pending changes inside that workspace will be lost. If unsure, cancel the operation and check in or discard any pending changes before the workspace is removed

  1. In the Manage Workspaces dialog, select the Team Foundation Server workspace that needs to be removed, and click the Remove button:

To remove the Team Foundation Server workspace from the CLI:

  1. Open the Command Prompt interface

    Change directory to folder that hosts Team Foundation Version Control Tool (tf.exe):

    CD C:\ProgramFiles(x86)\Microsoft Visual Studio\Common7\IDE

  2. To get a list of Team Foundation Server workspaces, type “tf workspaces” and press enter, for e.g.:

    CD C:\Program Files \Microsoft Visual Studio 12.0\Common7\IDE>tf workspaces

  3. To remove the unwanted workspace for the specified server from the client cache, type
    “tf workspaces /remove:(*|workspace1[,workspace2,…]) /server:(*|server)” , for e.g.:

    CD C:\Program Files <x86>\Microsoft Visual Studio 12.0\Common7\IDE>tf workspaces /remove:AMDKKND /server:https://tfs.apexsql.com:42526/tfs/default%20collection

Quick tip icon

Quick tip:

When a local client Team Foundation Server cached data is out of sync (e.g. When Team Foundation Server is migrated or network domain name has changed), the problem can be fixed by manual delete of all the files from the Team Foundation Server cache, located at:

C:\Users\{UserName}\AppData\Local\Microsoft\Team Foundation\{version}\Cache

  • Q: Can I use an existing workspace with ApexSQL Source Control?

    A: No. ApexSQL Source Control creates its own workspace when a database is linked to TFS. However, we do plan to provide the user with the option to use an existing workspace in future releases.

  • Q: What is the type of TFS workspace used by ApexSQL Source Control?

    A: ApexSQL Source Control uses Server workspace when working with TFS. For the differences between Local and Server workspaces, please visit this link.

  • Q: Can I switch the type of ApexSQL Source Control workspace from Server to Local?

    A: This can be achieved through Visual Studio but it is not recommended as ApexSQL Source Control was not designed to work with Local workspaces.

  • Q: What is the naming convention for workspaces created by ApexSQL Source Control?

    A: ApexSQL Source Control uses the following naming convention when creating workspaces:

    ApexSQL@<machine_name> – for the first workspace created, and
    ApexSQL@<machine_name><GUID> – for any additional workspace