Since_2008
Since_2008

Reputation: 2341

VS solution keeps trying to connect to old TFS server

I just downloaded a solution from a TFS server [tfsserver2].

The solution was originally developed and uploaded to [tfsserver]

[tfsserver] crashed. So this solution was then uploaded to tfsserver2.

I'm not the original developer, so I'm not sure how everything was setup. When I try to edit this solution, it keeps trying to connect to [tfsserver] even though I got the solution from [tfsserver2].

I tried looking for references (ctrl+shift+f) to tfsserver, but I couldn't find anything.

I tried clearing the Visual Studio cache.

Any suggestions on how this solution even knows about a server that hasn't existed for years?

Upvotes: 2

Views: 5434

Answers (4)

PhillyNJ
PhillyNJ

Reputation: 3903

This is an old post but wanted to share my solution.

  1. Open C:\Documents and Settings[USER]\Local Settings\Application Data\Microsoft\Team Foundation\2.0\Cache folder\LocationServerMap.xml
  2. Remove any ServerMapping entries you dont want

     <?xml version="1.0" encoding="UTF-8"?>
     <LocationServerMappings>
      <ServerMapping location="http://oldserver:8080/tfs/TeamFoundation/Administration/v3.0/LocationService.asmx" guid="..." />
      <ServerMapping location="http://oldserver:8080/tfs/Services/v3.0/LocationService.asmx" guid="..." />
      <ServerMapping location="http://oldserver:8080/tfs/defaultcollection/Services/v3.0/LocationService.asmx" guid="..." />
     </LocationServerMappings>
    

Upvotes: 1

AMissico
AMissico

Reputation: 21684

TFS caches this information locally. Use the command line utility tf. Open a Visual Studio Command Prompt and type tf for available commands. In your cases, useful commands would be workfold, workspace, and workspaces.

Upvotes: 0

pantelif
pantelif

Reputation: 8544

Check out your solution file & open it with an editor.
You shoud find an entry like:SccTeamFoundationServer =[tfsserver].
Changing it to your new TFS should do the trick.

You could also do this with "File" > "Source Control" > "Change Source Control..."


Since we 're talking about VS2010, the SLN file follows the Format Version 11.00 of MS VStudio Solution File.
Within the Global part of it, source control information is kept as a GlobalSection.
For SCM Perforce this is headed as GlobalSection(SourceCodeControl) = preSolution, for TFS it's headed as GlobalSection(TeamFoundationVersionControl) = preSolution.

You mention that when you select "Change Source Control" nothing happens. So, I would check out the SLN file, remove this section in a text editor, save & then load the solution in the IDE. It should then be possible to get where you 're headed, simply by right-clicking on the solution in Solution Explorer and selecting "Add Solution to Source Control...".

Upvotes: 1

Peter
Peter

Reputation: 14098

You might want to check this link: http://computermutt.wordpress.com/2011/04/11/changing-url-of-team-foundation-server-2010-projects/

I commented on your question about checking the .sln and/or .vbproj/.csproj files, but I don't use TFS myself, so I'm not sure. Checking the internet learns that your .sln file should include something like:

GlobalSection(TeamFoundationVersionControl) = preSolution
    SccNumberOfProjects = 2
    SccEnterpriseProvider = {xxxxx}
    SccTeamFoundationServer = http://some-other-guys-tfs-server/
    SccLocalPath0 = .
    SccProjectUniqueName1 = xxDemo\\xxDemo.csproj
    SccProjectName1 = xxDemo
    SccLocalPath1 = xxDemo
EndGlobalSection

I found the above here: How can I completely remove TFS Bindings.

Upvotes: 1

Related Questions