Friday, July 11, 2014

The Files Are Check-out After Back On-line

  My colleague said he has a problem on his visual studio solution. Every time, he worked on an offline solution. The files were check-out as soon as the solution is back online. It was so annoying for him. He could not just undoing pending check-out because it will lose all his works. He want my help on solving this problem.
  Since I could not reproduce his problem, it puts on the shelf for months. Later these days, he had the same problem again and kept the screen for me. After I saw the screen and told him to check those files that he modifies. It looked right after this action. Usually he just clicked OK button in that situation and all files were check-out. So the question was why TFS thinks all files are needed to check-out? I recalled my memory on how TFS manages the files. I knew the file’s attribute is set to read-only when it is check-in and writable when it is check-out. So I checked one file’s attribute in the file explorer and confirmed my suspicion. Even though the solution explorer shown they are check-in, the files’ attribute were writable. That’s why TFS thinks the files are modified.

  There is one more puzzle: why those files are writable during offline? My colleague believed he does not change those files’ attribute and I believed so. It was a tedious job to change those files’ attribute. Anyway, in order to avoid this problem again, my colleague had to set those files’ attribute to read-only manually.