TFS Change server port and visual studio 2012, pro

2019-04-12 17:24发布

问题:

I have been using tfs with no problems on local network with port 8080. Then i decided to change the port.... why o why did i bother. I have had a terrible few hours trying to sort it. Searched goggle for fixes etc. I think i now have it working but only after reall problems, this then makes me wander and worried about how to from visual studio 2012:

  1. have a local area network conenction to tfs: servername:9876
  2. remote connection: domain name: domain.com:9876

both of which map to the same folders on pc/ laptop and same projects on tfs server.

This caused masses of problems, i then delete the server and re added the correct one. Deleted all cache and workspaces. But then i couldnt map to location as it existed. then couldnt create a new worksapce it said it existed even after delteing the cache. In the end i delete all again, chose a new location on pc for to pull down solutions in tfs. This worked but i am afraid if i look at the solution file in notepad the server port is 8080 still even though the server is now 9876. Based on the above 2 questions what should i do next time. Or even should i still do to make sure all is clean and tidy.

I must have this wrong as it cant be so hard to change the port nunmber of the server or even the server name its self.

thanks

回答1:

TFS also registers your workspaces and machine names on the server. Run tf workspaces from the command line to figure out which and tf workspace to remove them. That should unblock you. Renaming your local machine (the client machine), or mapping to a different location on your local disk will unblock you.

You should use one single machine name, both locally and remote for the TFS server or map them as if they were different servers. Using both server names completely screws up the local cache, since the API will figure out that they're actually the same server because the Project Collection GUID and the Server ID match.

You could even use a line in your hosts file to be able to always use the same machine name.

I can't find the definitive piece of documentation that tells you to use the same name for all locations, but this blog post comes close. Architecturally, there are no changes between 2010 and 2012.