Home » Visual Studio

Working folder is already in use

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.


19 Answers Found


Answer 1

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.



Answer 2

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?


Answer 3

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.


Answer 4

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.



Answer 5

" 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!


Answer 6

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?



Answer 7

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.



Answer 8

When I run this command it only shows me one workspace and that is the one I deleted and re-created. Any other ideas?

Answer 9

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.



Answer 10

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.

Answer 11

Note that "tf workspaces /remove:* /s:*" is the logical equivalent of deleting the cache file.  It clears out the cached workspaces.



Answer 12

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




Answer 13

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



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>


Answer 14

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!



Answer 15

Yes, deleting a workspace will delete all of the pending changes associated with it.

Answer 16

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?!



Answer 17

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?



Answer 18

I had the exact same experience - only deleting the record directly in the dbo.tbl_WorkingFolder could help me out.

Answer 19


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




<< Previous      Next >>

Microsoft   |   Windows   |   Visual Studio   |   Sharepoint   |   Azure