Thursday, 15 December 2005
The first thing to understand about VSTS is the idea of a 'workspace'. The workspace is a client side 'copy' of the data held in source control. Workspaces provide a mapping of source control folders to local directories. Information about workspaces is held in two places, on the client and on the server. On the client the information about the workspace is held in C:\Documents and Settings\[user]\Local Settings\Application Data\Microsoft\Team Foundation\1.0\Cache\VersionControl.config. The VersionControl.config file maps the name of the workspace to the local directory on disk. It does not hold the mapping between the source control folders and the local directories; that information is held on the server in several tables (notably tbl_Workspace and tbl_workingfolder) in the TfsVersionControl database. No other information is held on the client about the files kept in version control (actually, each project has a .vspscc file associated with it, but this doesn't seem to hold much realm information).
Each user may have multiple workspaces on multiple machines, with each workspace holding different data. This is where things can get tricky. There is no connection between a workspace and a Visual Studio project. What this means is this. Suppose that you have a Visual Studio project open, that project may well be part of a workspace. You could also be using the Source Control Explorer in Visual Studio to be looking at the source code rtepository. The Source Control Explorer also lets you select a differnet workspace (see the image), however if you change workspaces in the Source Control Explorer you get no warning or signal that the workspace you are now browsing does not match the workspace of the project.
Remember that workspaces map Source Control Folders to local directories. This means that if you select a file from within the Source Control Explorer and open it, that file will open within Visual Studio, this may not be the same file as is in your Visual Studio project. You can edit this file and save it, but if you then build your project you will find your changes have not been added.
And the moral is: Be careful with your workspaces, they can lead to lots of misunderstanding!
Posted by Netat 11:42 PM in