2

I placed a file to be accessible by clients for download in my Web API project's App_Data folder. It worked fine on the first couple of tests, but then all of a sudden the server app complained about not having permissions to accept the file.

It turned out that the file had been automatically locked following a checkin of code. How can I prevent this file from being locked again? I simply "checked it out" of TFS, but I don't want to have to continue doing that.

At "checkin time" I can select the file in question and opt to "Exclude" it from the checkin, but it again reverts to being locked after the checkin process has completed.

Is there a way to mark a file or folder as a "no lock zone"?

13
  • 2
    That file should simply not be part of source control. Feb 21, 2014 at 1:22
  • I agree, but why was it assumed to be such by TFS, and how can I tell it to cease and desist? Feb 21, 2014 at 16:04
  • 1
    Is this a web site "project" (File-New Web Site), or a Web Application Project (File->New Project)? Also, are you using a local workspace? A local workspace will assume that newly-added files should be added to source control, unless it is informed otherwise. Feb 21, 2014 at 16:59
  • This is a Web API app. That is my question: how do I "inform it otherwise"? Feb 21, 2014 at 17:18
  • 1
    Wait, the file isn't locked, it's set to read-only, isn't it? Feb 21, 2014 at 17:51

1 Answer 1

2

There's a confusing terminology overload here: the file is marked as read-only on the filesystem. TFS uses the term locked to indicate that the file is checked-out by a given user and cannot be checked-out or checked-in by other users. The file is not locked, but it is read-only.

Team Foundation Server - when you're using a server workspace - marks the files as read-only when they are checked-in to the server and sets then to writable when the files are checked-out.

It sounds like you do not want this file in source control anyway. You should delete these files from source control (but not from your local machine). In the future, you should carefully review your pending changes so you do not add files that you are not interested in having in source control.

9
  • I didn't check that .exe on purpose; TFS automatically checked it in (I guess) when I did a "pending udpates" checkin. Maybe I should just explicitly check in those files that have changed, one at a time... Feb 21, 2014 at 16:05
  • 1
    There should be a context menu item for files and folders that allow you to exclude a file or folder from TFS purview/monitoring. Feb 21, 2014 at 16:51
  • 1
    If you're using a local workspace, then you can use the .tfignore functionality to exclude a file or folder. For server workspaces, you should manually avoid adding any files you do not want checked in. Feb 21, 2014 at 16:59
  • I don't want to have to resort to using command-line stuff; checking in files should be easy using a GUI. Feb 21, 2014 at 17:17
  • It sounds like it's too easy? Feb 21, 2014 at 17:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.