|Home||Back to Index|
I’ve had far less trouble with TFS source control than some people in our organization have. Applying the patches to the 2005 client helped. Now that we’ve upgraded to TFS 2008 (server and client), I hoped things would be better.
I spent an hour or so fighting with it today. I had a common task: I wanted to move a source file from one project to another within the same solution. Everything was already under source control. I wanted to preserve the version history of the file, too.
From past experience I know this trick: http://support.microsoft.com/kb/949476. That’s what I did. One of the two files moved fine; the other ended up with different local and server file paths in the TFS property dialog. After much struggle I finally gave up. I made a copy of the file, deleted it from TFS, and re-added it. Bye-bye, version history.
Bugs aside, why is this workaround necessary in the first place? Why can’t Visual Studio tell TFS, “I’m moving a file between projects - change its location in source control"? We use TFS for its tight integration with Visual Studio, but it’s clearly not tight enough.
Update - August 30, 2008
I posted to one of the Microsoft monitored newsgroups and got a response from Microsoft Online Community Support. Note that you do need to check the file in before checking the properties (and I did). Their response in part (I haven’t tried this yet, as it hasn’t happened again):
From your answers, I know that the issue is possibly caused by local name caching in TFS. In TFS version control database, there is a table named “tbl_LocalVersion” which caches local path of every item. When opening the file properties, TFS will get the cached local name from that table instead of calculating it every time. But it is strange that, in normal situation, TFS will automatically update the local version table whenever you move a file.
The solution is:
1. In source control explorer, right click on the folder which contains the file. On the context menu, click Refresh.
2. Right click the file, and click Get Latest Version.
When TFS get the latest version of a file, it will also calculate its latest local path and update it into the “tbl_LocalVersion” table.