Unlocking the Add button in Source Control Explorer

Last week I had an enquiry from a client asking me how to “Unlock the Add button in Source Control Explorer”. After asking a few questions I determined that the client had created a new team project (Procedures) and wanted to simply store a folder containing development related documents in Team Foundation Version Control (TFVC).  They had no intention of ever placing any VS solutions in the team project but just wanted to be able to version and store office documents and felt that their TFS server would be an ideal location. Over time they were going to use the work item tracking in TFS to record changes that needed to be made to the documents.

</TR></TABLE>

The Solution

The problem is related to the fact that no workspace mapping exists for the newly created $/Procedures folder. In the following walkthrough, I demonstrate the solution by adding a folder of office documents located at D:ProjectsProceduresDevelopment to TFVC in the $/Procedures branch.

To manually create a new mapping, follow these steps;

  1. Open Visual Studio 2005 (or the Team Foundation Explorer if you are using that.)
  2. Select File | Source Control | Workspaces…
  3. Click your default workspace (normally PC name), then click the Edit button as shown

    TFS_Add Disabled_2

  4. Click the next free line in the grid at the bottom of the dialog box, where it says “Click here to enter a new working folder
  5. In the Source Control Folder column, click the “…” button (1) and then add the Source Control folder name (Procedures)(2)  and click on the OK button (3)

    TFS_Add Disabled_3
  6. In the Local Folder column, either type the path to the folder you wish to map to or browse to the folder using the “…” button. (Eg. D:ProjectsProcedures). Click the OK button.

    TFS_Add Disabled_4
  7. You may be prompted to perform an update. If so, click the OK button.

    TFS_Add Disabled_5
  8. Close the Manage Workspaces dialog box
  9. If you look in the Source Control Explorer you should now see the Add button is available.

    TFS_Add Disabled_6

    To complete our walkthrough I have created a subfolder named Development that contains a couple of office documents to add to TFVC.
  10. Click the Add button on the toolbar in the Source Control Explorer and click Add Folder.
  11. Browse to D:ProjectsProceduresDevelopment folder and click OK. The contents of the folder will be displayed
  12. Click on OK
  13. </OL>

    You should now be able to see the folder and the documents it contains shown as pending changes in the Source Control Explorer.

    TFS_Add Disabled_7

    Checkin your pending changes and you’ll be ready to start updating and adding new files in no time

    </p>

</p>

The Problem

The screenshot shows the $/Procedures folder which was created by the Project Creation Wizard (PCW) on the tfs server. Notice how the “Add” button on the toolbar is disabled. This is a common occurance and one that can be quite frustrating for users who are not familiar with TFS Workspaces.

 

</TD>

TFVC_Add Disabled