views:

647

answers:

3

I recently moved to a new client where the source control system is TFS 2008. I have been using Subversion for almost 4 years so this is quite a change for me. One of the first things I noticed is that every time I try to modify a file Visual Studio (2008) tells me that the file is read-only. I spoke to the guy in charge of TFS and he informed that I need to manually check-out that file before I can modify it. So basically automatic checkouts aren't working for me.

The only advice I have gotten thus far is to enable it in Tools->Options->Source Control->Environment->Prompt for check-out. Which didn't work - it was enabled already. (Plus Visual Studio isn't even prompting me for a check-out - it just tells me the file is write-protected)

Is it possible that TFS is setup to not allow automatic checkouts? (I'm not allowed to touch the TFS setup - we have a whole department for that) Or am I just being blind?

A: 

TFS is of course able to automatically check out as soon as you start editing the file.

The option is under Source Control -> Environment -> Checked-in items

You should choose Editing: Check out automatically in the drop-down list.

Tor Haugen
Reading comprehension is important: *The only advice I have gotten thus far is to enable it in Tools->Options->Source Control->Environment->Prompt for check-out. Which didn't work - it was enabled already.*
Will
Yeah alright, sorry - only I suggested another option: Check out automatically. Could have worked!
Tor Haugen
Weeeeelllll.... I think he might have typo'd on that one. I think he wouldn't be complaining that his files aren't automatically being checked out if he specifically set it to Prompt...
Will
A: 

Bug. There isn't a fix for it yet (at least I don't think). I recorded my "workaround" (which is probably 3/4 voodoo but I can't repro to test what parts of this work) in a MSDN forum question that's the top hit on Google for this issue:

This is the #1 hit for "automatic checkout stopped working", so I am recording the solution for this in Visual Studio 2008.

This can happen when VS crashes. It can also propagate from one user to another after a crash.

Here are the steps to fixing this; follow them in this order and your problem will most likely go away.

  1. Check in everything
  2. Close visual studio
  3. Make sure every file is set to read only in the solution directory (set it on the root solution folder and configure it to propagate to children)
  4. Search for all files under the root projet directory *.user and *.vssscc and delete them (this might be overkill; one or the other may be the culprit but deleting both types won't hurt you)
  5. Open VS and load the solution
  6. Check everything back out and then check everything back in
Will
+1  A: 
Jim Lamb
Thanks - don't know how the hell that happens - I check it out of Source Control and set the bindings the first time...
Jaco Pretorius