How to remove a TFS Workspace Mapping?

2019-01-08 05:30发布

I had a project in tfs within a team project then we moved the project to a different location in another team project.

I had configured Jenkins to connect to the team project and build my solution but when I changed the settings to connect to the new tfs team project, it gives me the below error:

[workspace] $ "C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe" workspace -new Hudson-ProjectName1-Build-MASTER;domain1\username1 -noprompt -server:http://domain.net:8080/tfs/newteamproject ********
The path D:\jenkins\jobs\ProjectName1-Build\workspace is already mapped in workspace Hudson-ProjectName1-Build-MASTER [http://domain.net:8080/tfs/oldteamproject].

So the above shows that there is an existing workspace so I ran the below command to remove it

tf workspace -delete Hudson-ProjectName1-Build-MASTER;domain1\username1 -noprompt -server:http://domain.net:8080/tfs/oldteamproject

and it prompted that the workspace has been removed but I'm still getting the same error.

I also checked whether the mapping has been removed or not by running the below command:

tf workspace -server:http://domain.net:8080/tfs/oldteamproject Hudson-ProjectName1-Build-MASTER

but it says the workspace doesn't exist as expected.

So, I thought it might be caching it somewhere and ran the below command:

tf workspaces /remove:* /collection:http://domain.net:8080/tfs/oldteamproject

and it said "No workspace in the cache matches * from server http://domain.net:8080/tfs/oldteamproject"

so I'd guess it's not even cached.

So what's causing the error and how to resolve it?

18条回答
劫难
2楼-- · 2019-01-08 06:05

First download and install Team Explorer plugin in your system and then go to the Source Control Explorer. In the navigation pane find the Workspace field and click on Workspaces option. After clicking on Workspaces option, you will see all the workspaces that are mapped. Click on the remove button and the remove the mapping for required workspaces.

查看更多
时光不老,我们不散
3楼-- · 2019-01-08 06:06

Please follow the below steps:

Ctrl + Run 

Copy and Past

%LocalAppData%\Microsoft\Team Foundation

You will get different version of TFS e.g enter image description here

Click on each folder and you will get

enter image description here

Now Delete all data in these folder.

Reopen the Visual studio.

Thanks.

查看更多
Rolldiameter
4楼-- · 2019-01-08 06:06

Following are the steps to remove mapping of a project from TFS:

(1) Click on View Button.

(2) Open Team Explorer

(3) Click on Source Control

(4) Right click on your project/Directory

(5) Click on Remove Mapping

(6) Finally Delete the Project form local directory.

查看更多
干净又极端
5楼-- · 2019-01-08 06:08

Finally deleted ALL workspaces and started from scratch. Fixed.

查看更多
Explosion°爆炸
6楼-- · 2019-01-08 06:09

You can also remove a tfs mapping by simply editing your .sln file and removing the GlobalSection element for the tfs binding.

查看更多
Anthone
7楼-- · 2019-01-08 06:10

I ran into the same problem, and was able to fix it by manually deleting all the files in the TFS cache, located here:

%LocalAppData%\Microsoft\Team Foundation\3.0\Cache

or 4.0, 5.0, etc.

查看更多
登录 后发表回答