Lies TFS Told Me

This morning we suffered an air-conditioner failure in one of the server rooms. As our TFS server was deployed to a server with the words "dev" in it, naturally they thought they could just shut it down. After all, dev means development so it's not critical. I don't blame them however it caused a few issues. This one was shared to me by one of my developers so hopefully it'll help some of you out there in TFS land.

So apparently if the TFS server goes down while you're working on a file Visual Studio will allow you to work on the file locally. Makes sense. However, while editing the file, the server does not know that you have updated the file. Thus, when you reconnect to the server (or in this case the server comes back from the dead) TFS doesn't realize the file has been modified and will not save the changes to the repository when you complete a check-in.

To get TFS to check-in the modified file you must specifically go to each of the modified files and select Check Out for Edit. Then, select None - Allow shared checkout and click the Check Out button from the Check Out dialog that appears. Finally, check-in (commit) the files back to the source repository. 

The one other symptom is that your local files are not set to read-only like all other files when you try to update from the repository (Get Latest Version).

Something to watch out for in case your server goes bye-bye in mid-development.

Published Monday, March 12, 2007 5:41 PM by Bil Simser
Filed under:

Comments

# re: Lies TFS Told Me

Monday, March 12, 2007 8:24 PM by lvildosola

There's is an alternate way to synchronize. There's a TFS Power Toy that will check for files that have been modified and attempts to determine if there are differences. See http://www.codeplex.com/VSTSGuidance/Wiki/View.aspx?title=How%20to%20work%20off-line&referringTitle=Source%20Control%20Practices%20at%20a%20Glance

# re: Lies TFS Told Me

Monday, March 12, 2007 8:45 PM by Ishai Sagi

I had a similar problem with source code I wanted to publish to http://www.codeplex.com/spstipsUtilityPack

I wrote the code on a machine without internet access, then copied it to a connected machine and connected to TFS from there. but since I didnt know how to do what you are describing, I lost all my changes!

*sigh*

# re: Lies TFS Told Me

Monday, March 12, 2007 9:02 PM by Chris Chapman

...or use Subversion...

If your server goes down, it's no big deal to re-synch when you get it back up - just grab a new copy, resolve any conflicts (if any) and do a check-in.

I know - TFS has a lot of other features, but damn! They come at a price in terms of complexity.  SVN can run as a service on your Win2k3 server on the file system with minimal impact and no need for SQL.

# re: Lies TFS Told Me

Tuesday, March 13, 2007 12:13 PM by AndrewSeven

I thought there would be outright lies like the one it sometimes tells me about files I don't have a local copy of.

"You already have the most recent version of the file."

# re: Lies TFS Told Me

Tuesday, March 13, 2007 2:24 PM by Bil Simser

@Andrew: Actually (at least my copy) does tell me that from time to time. It'll tell me I have something checked out and it's different, but when I run the compare facility it says "Files are identical". Nice.