TFS in a lab environment - Beware caching issues

Published 05 July 06 09:40 AM | dmckinstry

As a consultant specializing in Visual Studio Team System, I spend a significant amount of my time customizing and extending Visual Studio and Team Foundation Server.  Just as most people develop applications in a development environment before deploying to a production environment, I do my TFS development in a lab environment and only push to a client's server after the work is mostly complete.  I work with many difference clients and tend to need different lab environments for each.

Which brings us to one of my favorite technologies for this purpose but also one to watch out for...  Microsoft Virtual PC.  Regardless of which virtualization technology you prefer, creating a virtual machine to act as your lab TFS makes perfect sense.  In my case, I have several variations of the same TFS virtual image that I run depending upon which client or project I'm supporting.  As long as I only have one copy booted at a time, everything works great, except for...

Visual Studio and Team Explorer provide a caching mechanism which can get out of sync.  If I have multiple instances of a single TFS which can be connected to from a single Visual Studio client, that client can become confused.  Symptoms vary, but I've had what appears to be connectivity or security issues but were actually related to trying to use cached data from one TFS instance against a different instance.  Some of the problems were more esoteric but equally confusing, including phantoms in work item definitions or TFVS.

Although there are probably other ways to help, the simplest way that I've found is to delete the cache for the TFS on the client machine.  The cache is kept in two subdirectories, named based on a server GUID, under:

C:\Documents and Settings\{your account}\Local Settings\Application Data\Microsoft\Team Foundation\1.0\Cache

Although I connect to many different TFS servers, I know the GUID for my favorite lab TFS server.  Whenever I need to switch between VPC instances of that server, I clear the cache by shutting down Visual Studio, deleteing directories {Server GUID} and {Server GUID}_http from the aforementioned directory, and then restarting Visual Studio.

In many cases things looked like they were working fine without clearing the cache, but not that I know how this caching mechanism works, I always clear it when I move between different instances of the same TFS - just in case.

Filed under:

Comments

# Team System News said on July 6, 2006 12:18 AM:

Dave McKinstry on ASP.NET 1.1 projects with Team Foundation Version Control , Understanding ChangeSets...

# Naga said on November 17, 2008 02:16 PM:

The path has changed in the 2008 - C:\Documents and Settings\[login account]\AppData\Local\Microsoft\Team Foundation\2.0\Cache

# niall said on March 19, 2009 05:39 AM:

Hi Dave,

Thanks for this, I got a bit of a shock this morning when I switched back to my main TFS and found it had lost all my changes from last week, as I's shifted to a temp version of TFS while the real was offline.

Fortunately for me a colleague tipped me off to this post and I found to my delight that VS was still showing me the temp TFS versions files and histories

:)

# Aaron G said on March 30, 2010 02:50 PM:

The path has changed in Windows 7

C:\Users\[login account]\AppData\Local\Microsoft\Team Foundation\2.0\Cache

Leave a Comment

(required) 
(required) 
(optional)
(required) 

This Blog

Microsoft VSTS Blogs

MSDN Forums

VSTS Community Blogs

Syndication