I have set up gated check-in as well as single signout/exclusive checkout in TFS 2010. Now when my users try to run a gated check-in, the option to “Preserve my pending changes locally” cannot be checked as it is greyed out/disabled and unchecked.
I need to be able to preserve local changes so my users do not have to search for their shelveset and wrestle with unshelving changes.
It turns out that when you exclusively check out a file for edit, the TFS build service can’t unshelve or check in (commit) your changes if your local changes are preserved.
So you can either have an exclusive lock on the files or check the Preserve my pending changes locally option. You can’t do both of them.
As a workaround, I am currently looking for a way to automatically unshelve, or get latest changeset back into a users local workspace after a locked gated checkin is attempted.