TFS Build keep throwing 'Unable to perform the get operation because the file already exists locally' error

11,405

Solution 1

In TFS 2015, VSTS, I solved the issue by selecting true from the dropdown shown below:

enter image description here

Don't forget to set it back to false after the build succeeds because if you leave it on, it will always do a clean and thus the build will take longer.

Solution 2

In your build definition, do you have Clean Workspace option set to All?

enter image description here

If that doesn't help, can you set the Logging Verbosity to Diagnostic and see if there is anymore detail about the issue.

Solution 3

Since you are on TFS 2015 Build (not XAML Build), you can check Clean on the repo tab of the definition.

FYI - the new agent on VSTS and in TFS 15 RC1 passes /overwrite to tf get so you won't need to do a clean build every time.

Solution 4

I came across this thread after getting the error "Warning s - Unable to get because a directory already exists" in a build definition in TFS 2018. For me, I eventually figured out that the issue was because I specified the full solution path instead of just the solution directory in the server path of the build definition. Removing the solution name from the path (so it was just a folder reference) solved the issue. Hopes that helps others coming across this thread.

TFS Build Definition Image

Share:
11,405
garam93
Author by

garam93

Updated on July 28, 2022

Comments

  • garam93
    garam93 over 1 year

    I am currently working on an ASP.NET based web application which is version controlled via TFS. A TFS Build server is configured so it is running the build process on every checkin. My problem is that whenever I modify the Web.Config file and check in the modifications, the build process keeps throwing an error when getting the source which says 'Unable to perform the get operation because the file already exists locally'. I tried to remove the Web.Config from TFS and checked in the modifications, but the error was still there, saying 'Unable to perform the delete operation because the file already exists locally'. But when I manually delete the file from the build server's filesystem, the problem is gone. What do you think the problem is? I have not found anything relevant to this on google, so I would be really happy if you could help me. Thanks a lot!

  • garam93
    garam93 about 8 years
    Thanks for the reply. I forgot to mention that the build server uses the new TFS 2015 build definitions so I can't try what you suggested. I did not find neither the clean workspace nor the logging verbosity setting on the 2015 version.