George M Ceaser Jr
George M Ceaser Jr

Reputation: 1791

Cannot map TFS to local folders

Technical Info: - TFS 2013 Express - Visual Studio 2015 Update 3

Background: I had a domain named PSS1 with one domain controller names PSSDC-01. TFS was on the domain controller. I had issues with the domain controller. I moved TFS to a new VM named PSSTFS running Windows Server 2016. I attempted to fix the domain problems. I could not fix the domain problems so I built a new Server 2016 PSS1 domain control but it is technically a new domain. In other words, I clicked the new domain button when installing the AD. I added all the same users etc. back to it. I removed all the computers from the old PSS1 domain and put them in a workgroup. Then added them all the computers to the new PSS1 domain.

Problem: Of course when I did this all the user IDs etc. got new GUIDs from the new domain even though they are the same user name. Now in Visual Studio 2015, when I try to map TFS to a local folder that was also mapped to TFS under the old PSS1 domain, I get the following error message:

**XXXXXXXXXX is the folder that was mapped under the old domain and that I am trying to may the current TFS to.

WWWWWWWW is the workspace that existed under the old domain and also exists in the new domain (i.e. I did not create a new workspace) NNNNNN is the name of the user CCCCCCC is the name of the computer containing the directory I am trying to map to.**

The working folder D:\Visual Studio 2015\Projects\XXXXXXXXXX is already in use by the workspace WWWWWWWW;NNNNNN on computer CCCCCC.

I have tried clearing the config files in TFS' app data folder but that did not work. I have tried deleting the workspace on the local machine. When I did this, the workspace went away for a second but when I came back into the workspace manager to re-create it, it was listed there again.

Any suggestions would be greatly appreciated.

UPDATE: I added a new workspace, deleted the old one and tried to map to the folder again and it did not work. I then added the old workspace back in (named NewToshibaWin8 which should have used the new GUIDs for everything) and tried to map again. I got the message that the folder is already in use by workspace NewToshibaWin8. I even get that when the NewToshibaWin8 workspace did not show in the workspace list.

Upvotes: 1

Views: 1027

Answers (1)

George M Ceaser Jr
George M Ceaser Jr

Reputation: 1791

OK after trying everything else I read, my solution involved deleting items from the database. I used information from this question as a base:

How to remove a TFS Workspace Mapping?

WWWWWW = Workspace Name

IIIIIIII = WorkspaceID retrieved in the first query.

I went into my Tfs_DefaultCollection database and ran the following query:

/*Query to execute*/
SELECT WorkspaceId, * FROM tbl_Workspace ORDER BY WWWWWW 

So to my surprise, the workspace I had delete still showed up in the results from the select. So I noted the WorkspaceID and used it in the next query.

/*Query to execute*/
SELECT LocalItem, * FROM tbl_WorkingFolder WHERE WorkspaceId = IIIIIIIIII

Again to my surprise there were items returned in the select. Hoping there was referential integrity on the database, I ran the following query to delete the Workspace

/*Delete Workspace*/
Delete tbl_Workspace WHERE WorkspaceId = IIIIIIIIII

So then double checking the queries below again, I found that the mappings did not get deleted.

/*Query to execute - The workspace should be gone now*/
SELECT WorkspaceId, * FROM tbl_Workspace ORDER BY WWWWWW 

/*Query to execute - The mappings for the deleted workspace still existed*/
SELECT LocalItem, * FROM tbl_WorkingFolder WHERE WorkspaceId = IIIIIIIIII

So then I ran the query to delete the workspace mappings as follows:

/*This will delete the actual mappings*/
Delete tbl_WorkingFolder WHERE WorkspaceId = IIIIIII

After the second delete I re-ran the select queries listed above and the workspace was gone and all the mappings for it were gone.

Once this was complete I was able to re-map the server projects to the directly on my local machine that was previously giving the following error:

The working folder D:\Visual Studio 2015\Projects\XXXXXXXXXX is already in use by the workspace WWWWWWWW;NNNNNN on computer CCCCCC.

Hope this helps.

Upvotes: 1

Related Questions