Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

jenkins - How to remove a TFS Workspace Mapping?

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.0Common7IDEf.exe" workspace -new Hudson-ProjectName1-Build-MASTER;domain1username1 -noprompt -server:http://domain-eg.net:8080/tfs/newteamproject ********
The path D:jenkinsjobsProjectName1-Buildworkspace is already mapped in workspace Hudson-ProjectName1-Build-MASTER [http://domain-eg.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;domain1username1 -noprompt -server:http://domain-eg.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-eg.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-eg.net:8080/tfs/oldteamproject

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

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

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

From VS:

  1. Open Team Explorer
  2. Click Source Control Explorer
  3. In the nav bar of the tool window there is a drop down labeled "Workspaces".
  4. Extend it and click on the "Workspaces..." option (yeah, a bit un-intuitive)
  5. The "Manage Workspaces" window comes up. Click edit and you can add / remove / edit your workspace

source control explorer

From VS on a different machine

You don't need VS to be on the same machine as the enlistment as you can edit remote enlistments! In the dialog that comes up when you press the "Workspaces..." item there is a check box stating "Show Remote Workspaces" - just tick that and you'll get a list of all your enlistments:

show remote workspaces

From the command line

Call "tf workspace" from a developer command prompt. It will bring up the "Manage Workspaces" directly!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...