none
Working folder is already in use

    Question

  • Just migrated from VSS to TFS and its fantastic!

    Having a problem on my PC when trying to get source code for a project. I get the message 'The working folder is already in use by another workspace on this computer'.

    I have cleared all the work spaces for all users on my machine (as far as I can tell) by clearing down the C:\Documents and Settings\[user]\Local Settings\Application Data\Microsoft\Team Foundation\1.0\Cache\VersionControl.config files. I have also had a poke around in the tbl_Workspace and tbl_Workingfolder on the server to make sure there are no stray workspaces defined.

    Does anyone have any ideas on how to resolve this?

    One thing that may be causing the problem is that our development team is working on virtual PC images which, for various reasons, have the same machine name. I would have thought that the workspaces are defined by machine and user so this would not be a problem.

    Anyway any input would be appreciated! Thanks.

    Saturday, July 08, 2006 9:51 AM

Answers

  • Interesting... So basically you are saying that machine name and user name is not sufficiently unique to indentify a computer - because the same user may have multiple machines with the same name.

    Hmmm.  I don't have a great suggestion for you other than to fool TFS into thinking it's a different folder as zabrucewayne suggested or a different user name.  We'll look at this issue though and see if there's something we can do in the future that would alleviate this.

    Brian

    Monday, July 10, 2006 11:40 AM
  • Yes, deleting a workspace will delete all of the pending changes associated with it.
    Friday, March 23, 2007 8:35 PM

All replies

  • This means that the server believes this folder is already in another workspace.  You shouldn't ever delete stuff from the local cache file manually as it will leave the server still believing it.  You should run

    tf workspaces /server:http://server:8080

    This will rebuild your cache for the server and allow you to see what workspaces and working folders the server things you have.  Then you can use the File -> Source Control -> Workspaces menu to review your workspaces and delete any working folder mappings that you don't want.

    Brian

    Saturday, July 08, 2006 11:54 AM
  • Yes that is exactly the problem, the server believes this folder is already in use in another workspace.

    But this is because of the duplicate machine names due to the Virtual PC configurations and not because the folder actually exists on the machine.

    It is not a possibility to change the machine name as we have Biztalk 2006 and Sql Server 2005 etc installed already.

    Any recommendations from anyone?

    Monday, July 10, 2006 8:53 AM
  • The solution we have found is to use NTFS junction points to allow TFS to create workspaces mapped to a unique folder name, with the underlying folder name the same on each machine.

     

    Monday, July 10, 2006 9:50 AM
  • Interesting... So basically you are saying that machine name and user name is not sufficiently unique to indentify a computer - because the same user may have multiple machines with the same name.

    Hmmm.  I don't have a great suggestion for you other than to fool TFS into thinking it's a different folder as zabrucewayne suggested or a different user name.  We'll look at this issue though and see if there's something we can do in the future that would alleviate this.

    Brian

    Monday, July 10, 2006 11:40 AM
  • " So basically you are saying that machine name and user name is not sufficiently unique to indentify a computer - because the same user may have multiple machines with the same name."

    Well nearly. What I am saying is that different users may be working on different machines with the same name and with the same mappings i.e.: destination folders.

    So, for example:

     User1 gets the latest version of $\Program1 to workspace WS1 mapped to folder c:\program1

     User 2 gets the latest version of $\Progam1 to workspace WS2 mapped to folder c:\program1

    This would fail for User 2 as the destination folder is mapped to User1 already. Even though they are on separate physical machines, the server doesnt recognise this as they share the same machine name.

    As I mentioned, I have managed to resolve the issue by setting up a junction point so that for example c:\program1_user2 would point to c:\program1. Existing references are not broken and workspaces mappings are happy!

     

    Monday, July 10, 2006 11:54 AM
  • I am getting the same error and I did the following.

     

    tf workspace /delete /server;http://server:8080 TESTWORK;TFS\TESTUser

    This command deleted successfully.

    tf workspace /server;http://server:8080

    I then opened VS.NET2005 and tried to map C:\CODE and it still says.

    The working folder C:\CODE is already used by another workspace on this computer.

     

    Any ideas?

    Steve

     

    Wednesday, July 26, 2006 12:42 PM
  • The server still thinks you have that path mapped somewhere.  You can run

    tf workspaces /server:http://server:8080 /computer:bharry-client

    to show all workspaces that are on this computer (obviously replacing server and bharry-client with appropriate values).  You can then inspect each of those workspaces and see which has c:\code or something above it or below it mapped.  It's important to note that TFS does not allow workspaces to overlap.  The same folder (anywhere in the directory structure) can not be in two workspaces at the same time.

    Brian

    Wednesday, July 26, 2006 12:55 PM
  • When I run this command it only shows me one workspace and that is the one I deleted and re-created. Any other ideas?
    Thursday, July 27, 2006 2:38 PM
  • Could you post the output of that command and then the output of:

    tf workspaces /computer:computername /owner:* /format:detailed

    Also include the exact operation you are doing when you get the error and the exact error message.

    If that doesn't highlight anything we need to look at your database.

    Brian

    Thursday, July 27, 2006 4:19 PM
  • Note: I believe the error message you reported actually comes from the client.  Try deleting your local cache (%userprofile%\local settings\application data\microsoft\team foundation\1.0) and see if that helps.
    Thursday, July 27, 2006 6:00 PM
  • Note that "tf workspaces /remove:* /s:*" is the logical equivalent of deleting the cache file.  It clears out the cached workspaces.

    Buck

    Wednesday, August 09, 2006 1:59 AM
    Moderator
  •  

    Hi  steve

    I had the same problem in one of the client machine.

    It was used by user say username 1

    i used the following command from command prompt

    tf workspace /delete /server:http://TOUFS1002:8080 <ComputerName>;TOUFS1002\<username1>

    After the this the new user was able to map the working folders

    Regards

    Guru

     

     

    Thursday, September 14, 2006 9:16 AM
  •  Gururaja wrote:

    Hi steve

    I had the same problem in one of the client machine.

    It was used by user say username 1

    i used the following command from command prompt

    tf workspace /delete /server:http://TOUFS1002:8080 <ComputerName>;TOUFS1002\<username1>

    After the this the new user was able to map the working folders

    Regards

    Guru



    Just to clarify something here,

    The workspace can be created with a name that does not match the computer name.

    So therefore the above command should be this instead:

    tf workspace /delete /server:http://TOUFS1002:8080 <WorkspaceName>;TOUFS1002\<username1>





    Tuesday, January 16, 2007 9:52 AM
  • Hi Everyone!!

     I have exactly the same problem that you have been discussing...I use a copy of the VPC that one of my colleague uses to develop the product and we have to use the working folders. But when I try to map the server to the folder on my local machine it throws the Working folder is already in use error......

      I wanted to know if I use this command, that is mentioned here (tf workspace /delete /server:http://TOUFS1002:8080 <WorkspaceName>;TOUFS1002\<username1>), delete any of the pending changes or any workspaces on my colleagues machine or from the TFS itself? I appreciate a quick response in this regard!

     

    Thanks

     

    Friday, March 23, 2007 2:40 AM
  • Yes, deleting a workspace will delete all of the pending changes associated with it.
    Friday, March 23, 2007 8:35 PM
  • Hi, my problem is clearly related.

     

    If I attempt to add a workspace (VS2008, VS2005) anywhere on the path c:\USR I recieve the error "already in use by another workspace on this computer".

     

    The tf commandline tool hasn't helped. I've deleted the local cache.

     

    Next step is to look in the TFS database. But this is blind poking around in the dark really.

     

    How do I tell TFS that there ISN"T a workspace using that path?!

     

    Thanks

     

    Wednesday, August 20, 2008 2:52 AM
  • Hi again, problem solved

     

    dbo.tbl_WorkingFolder contained a spurious record for my laptop which was causing the problem. The record was immune to any cache or workspace operation. There were multiple workspace instances named after my laptop, one of which couldn't be touched using tools other than directly modifying the database.

     

    If this is the case, then this is VERY, VERY bad.

     

    Referential integrity anyone?

     

    hmmm...

     

     

     

     

    • Proposed as answer by Uri Goldstein Thursday, February 05, 2009 1:51 PM
    Wednesday, August 20, 2008 3:33 AM
  • I had the exact same experience - only deleting the record directly in the dbo.tbl_WorkingFolder could help me out.
    Wednesday, February 11, 2009 9:41 PM
  • Hi,

    I know this is an old post but I just wanted to point out that it has solved the issue for me. We had the same error message because a user had been deleted, then recreated and we ended up with the 'working folder is in use by another workspace' error that we could not get rid of by deleting workspaces, clearing local cache etc. The only thing that fixed it was going into the DB and deleting the working folders for the workspace in question.

    Execute the following SQL against the TfsVersionControl database

    -- search for the working folder which is causing the problem.

    select * from tbl_workingfolder where localitem like '%projects\project1%'

    -- now find the relevant workspace using the workspaceid returned in the first query so we can verify we are looking at the right one

    select * from tbl_workspace where workspaceid=<<workspace id from workingfolder row>>

    -- when you are sure you have the correct workspace, delete the workingfolders for it. (I chose to delete them all but you could just delete the one that causes the problem)

    delete from tbl_workingfolder where workspaceid=<<workspaceid>>

    Hope that is of some help

    Dan

    • Proposed as answer by JSale Friday, February 04, 2011 6:14 PM
    Thursday, July 15, 2010 10:58 AM
  • THIS, HAS BEEN WORKED FOR ME! GREAT!  Thanks!

    Non Scripted Human

    Friday, April 20, 2012 2:25 PM
  • Another vote here for differentiating workspaces more accurately.

    We have development VMs with SQL, AD, SharePoint, etc. preconfigured that we hand out to our devs. The users and machine names are identical, and we can't rename the machines because it will screw up SQL and SharePoint. 

    Having to resort to unique folder names or junction points to enable our developers to work on the same project is a major hassle. There has got to be a better way to guarantee a workspace is unique besides a combination of path and machine name.

    Wednesday, January 08, 2014 8:11 PM