Change TFS Server Mapping - tfs

Running VS 2010, I want to now build on TFS 2010.
Originally I connected TFS server "tfs1". Now I want to map my local path to new TFS server "tfs2".
How to disconnect my old mapping with tfs1?
I got an error:
The path C:\test\xxxAdmin is already mapped in workspace aaa-PC[http://tfs1:8080/tfs/windowsapp]
Thanks.

In the source control explorer for your old server, you can drop down the "Workspaces" list, choose "Manage workspaces," and delete the workspace you no longer want to use.

Most of the time you can go to the directory in question ("C:\test\xxxAdmin") in a VS command window (Start->All Programs\Microsoft Visual Studio 2010\Visual Studio Tools\Visual Studio Command Prompt (2010)) and then enter "tf workspace". Unless things are a bit screwy this will bring up the GUI "Edit Workspace". Find the directory in the "Working Folders" list, select it, and click "Remove".
You should now be able to create the new mapping

Select Manage workspaces and delete the workspace that you don't need.
You can also use tool Tfs Workspace

Related

How to delete TFS workspace doppelgangers

I'm using VS2017 and VSTS. After a number of OS upgrades I've now ended up with 3 workspaces that points to my computer. If I run the command "tf workspaces /owner:* /computer:{my computer} /server:https://{xxx}.visualstudio.com /format:detailed" I can see that the workspaces are all identical except that they have unique working folders.
Instead of keep adding new workspaces that points to different folders, I would like to scratch them all and start over. However, when I run the command "tf workspace /delete /server:https://{xxx}.visualstudio.com ", I get the following error message: "TF14061: The workspace {my computer};{owner/my name} does not exist.".
And, If I try the same command but with owner specified and/or with collection specified and/or with location specified, I get the following error message: "Specify one workspace."
Any ideas on how to solve this issue would be appriciated.
It they are your personal workspaces then you can also delete them using the Manage Workspaces dialog opened from the Source Control Explorer. If your computer name changed as part of the OS upgrades, you need to tick the Show remote workspaces checkbox in the bottom of the dialog.
Simply mark the workspaces that you want to delete and click the Remove button:
This guide is for Visual Studio 2012, but nothing has changed.
As suggested elsewhere Team Foundation Sidekicks is also a good way of removing workspaces - both your own and others. It does not work out of the box on a computer with only VS 2017, but there is a workaround for this.

TFS file must remain locked

I have some 3rd party dlls checked into TFS
Our machines were renamed and now TFS believes they are checked out for edit by me on another machine.
I tried tf lock /lock:none contrib64/* /workspace:oldmachine;myusername but I get the error
TF10152: The item $/XXX/YYYY/contrib64/third_party.dll must remain
locked because its file type prevents multiple check-outs.
1, Is there any way around this ?
2, Is TFS really this bad or is it just me ?
3, Is the purpose of TFS to make us nostalgic for VSS?
ps It's a hosted version so I can't just get the admin to fix it.
Undoing the lock won't work on those files because they are binary, as binaries cannot be merged they must be locked if they are checked out.
As the machine the workspace resides on no longer exists (the machine has been renamed) the best thing to do is delete the workspace.
from a Visual Studio command prompt
tf workspace /delete oldmachine;myusername /collection:http://*tfsserver*:8080/tfs/*collection*
This will remove the workspace and undo all pending changes
If you don't want to delete the workspace, you can undo the change and unlock the file after that:
Using a Visual Studio developer command prompt:
tf undo "$/<server-path-to-file/folder>" /workspace:"<workspace>;<user>" /collection:<collection-url> /recursive
tf lock "$/<server-path-to-file/folder>" /lock:none /workspace:"<workspace>;<user>" /collection:<collection-url> /recursive
Files with .dll extension as well as other extensions like .exe, .doc, .docx, etc. are automatically locked because (as mentioned) here they cannot be merged.
If you want to disable the automatic lock and allow these files to go through gated check-in, follow the steps below:
Log in to your build server.
Open visual studio.
In team explorer, log into your team project.
Go to "Settings".
Under "Team Project Collection", select "Source Control".
Set "File Merging" property to "Disabled" for any file extension you don't want to be automatically locked.
Reference: https://blogs.msdn.microsoft.com/phkelley/2008/11/12/everything-you-ever-wanted-to-know-about-locks/
This worked for me.
I needed to change settings in 2 places:
At Visual Studio, team project window, Settings->Team Project Collection -> Source Control
Enable File Merging for the extension.
2) At Visual Studio, team project window, Settings->Team Project -> Source Control
Enable the multiple check-out box

Getting "Failed to create mapping" when adding a solution to TFS source control

I've created a new Team Project in TFS, but when I try to add my solution to it I get:
'Failed to create mapping
Cannot map server path, $/Finance/MyApp, because it is not rooted beneath a team project.'
I can't find anything on google or here that looks remotely like this problem.
I had this issue when using Microsoft's Team Foundation Service from Visual Studio 2012. I had just created the new team project via the TFS website. Although I could see my new project in the 'add solution' window, I got the error the OP reported.
I had to go into the "Team Explorer" window, then into "Connect to Team Projects" and tick the new project. Then I was able to add my solution to the team project.
Is Finance a team project for you?
If not, you can clear the mappings for the workspace or even just delete your workspace.
http://msdn.microsoft.com/en-us/library/54dkh0y3(v=VS.100).aspx
Had the same issue when upgrading project to TFS 2010 from 2008. The solution was to delete the vsssc file in the root of the project folder and re-add it
In my case I had to do Team Explorer and connect to the new project
then I had to close my solution and re-open and then the "add to source control" worked.
--Connect and check project in team explorer window
--Close solution
--Open solution
--retry adding solution to source control
I had this issue with Visual Studio Online's source control, Visual Studio would not recognize the team project even after connecting to team projects, refreshing, restarting Visual Studio. I had to use the "Open in Visual Studio" link from the project on the Visual Studio Online site and then open the solution from there.
Well, i didn't want to do anything so drastic, it turned out that one of my subfolders inside the solution i wanted to add to source control, was mapped inside a different workspace (on a different TFS server). So the solution was to connect to that other TFS server, find and delete the conflicting folder mapping inside that workspace, and try again.
I had the same problem using visual studio 2008 and TFS 2012. In my case, when I manually added the local folder to the project through the workspace mapping, the problem went away.
File -> Source Control -> WorkSpaces -> Edit
Then when I went to add the solution to source control it detected the mapping automatically.
In my case, I copied the folder from "My Documents" to c:\tfsroot where I had mapped the TFS Root. Then when I opened the solution and added it to TFS it worked.
I had the same problem. My solution in VS2017:
Open Team Explorer tab
Select Source Control Explorer
Right click on the top level folder for the project and select "Advanced/Remove Mapping"
Remove the Mapping
Right click on the top level folder for the project and select "Advanced/Map to Local Folder"
Browse to the top level folder with the source code (You may need to adjust the path you selected. It may append a folder name to the end)
Click "Map"
Answer "Yes" to Message Box "Newly mapped items will not be downloaded until you execute a get. Do you want to get $/YourFolderName now?"
That should do it!

TFS Project is visible in the Source control explorer but not in Team Explorer?

I'm able to view the project
1.from the Source Control Explorer but not in Team explorer,Only if i have open the local project which is binded to TFS Only then i can view the other folders within in TFS Project.
2.From Tfs command Line Utility
3.Suppose there are no workspaces and no projects downloaded from TFS then only way to view the project is from the command line Utility.
Is there any way fix this issue.
Right click on the root in the team explorer pane, and select "Add existing team project". You should be able to select the new project from there.
It sounds like a permissions issue. I'm guessing you don't have permissions set up on the Team Project, but you do have read permissions on the source control. Keep in mind that, though the two are related, they are stored and maintained separately in the back-end.

No commands available on context menu of Source Control Explorer

I don't know what I've done, but on my TFS source control explorer I have "No commands available" on the context menu! (Panic is setting in)
From the Team Explorer I can see that am a member of Team Foundation Administrators, and I'm a member of the team project administrators as well.
What would be causing TFS to give "no commands available" on the pop-up context menu?
Additional info:
I can get to the source control explorer and with additional commands from another machine, so perhaps it's something pooched on my setup (although it was working an hour ago!)
In Visual Studio, go to Tools > Options...
Click "Source Control" in the tree
Select "Visual Studio Team Foundation Server" as the current source control plug-in.
If this option is not available, ensure that you have Team Foundation Client installed.
You need to checkout (Mapping is not enough for Moving and Renaming - for that you MUST check-out) those files/folders to your local disk, before you get the context menu on right-click that you miss.
I had same problem and from the MSDN official page I was not too much wiser :)
Anyway, I wonder what is the good reason, for which you can not move files in TFS server repository without checking-out those items to my disk. In SVN this is no problem. (And there is even no path mapping in SVN - just CheckOut :)

Resources