Keywords: TFS binding removal | source control | Visual Studio migration
Abstract: This article provides a comprehensive guide on completely removing Team Foundation Server (TFS) source control bindings from Visual Studio solutions. It first details the standard method through Visual Studio's graphical interface (File → Source Control → Advanced → Change Source Control), suitable for most TFS migration scenarios. For situations where the GUI is inaccessible, the article presents manual editing techniques for .sln files, including deleting .suo files and modifying the GlobalSection(TeamFoundationVersionControl) section. Additionally, it introduces third-party tools as automated alternatives and discusses the practical applications of these methods in TFS version migration projects.
Standard Graphical Interface Method
The most straightforward approach to remove TFS bindings in Visual Studio is through the integrated source control interface. Users can access this functionality via: File → Source Control → Advanced → Change Source Control. This interface displays a list of all solution and project bindings.
To proceed, first select the solution node and click the Unbind button. This removes solution-level binding information. Next, repeat this process for each project by selecting project nodes and clicking Unbind. In some cases, if temporary disconnection without complete removal is desired, the Disconnect option can be used, though this is often insufficient for TFS version migration scenarios.
After completing all unbinding operations, TFS metadata is cleared from solution and project files. Users can then switch source control providers in Tools → Options → Source Control → Plug-in Selection. This method is based on the SCC (Source Code Control) specification, ensuring consistency across different version control systems. Testing confirms its effectiveness with VSS, TFS, and AnkhSVN.
Manual Solution File Editing
When Visual Studio installations have never been configured for TFS connections, or when handling third-party solutions, the GUI method may be unavailable. In such cases, manual editing of solution files becomes necessary. A common issue is encountering a prompt when opening solutions: "Go Offline
The Team Foundation Server http://some-other-guys-tfs-server/
is currently unavailable.
The solution will be opened offline."
The first step is to delete the .suo file located alongside the .sln file. This file stores user-specific solution options, including source control states. After deletion, open the .sln file in a text editor (like Notepad), locate and remove the entire GlobalSection(TeamFoundationVersionControl) section. A typical structure appears as:
GlobalSection(TeamFoundationVersionControl) = preSolution
SccNumberOfProjects = 2
SccEnterpriseProvider = {xxxxx}
SccTeamFoundationServer = http://some-other-guys-tfs-server/
SccLocalPath0 = .
SccProjectUniqueName1 = xxDemo\xxDemo.csproj
SccProjectName1 = xxDemo
SccLocalPath1 = xxDemo
EndGlobalSection
After removing this section and saving the file, reopening the solution in Visual Studio eliminates TFS binding prompts. Although this method requires direct file manipulation, it proves particularly useful for legacy projects or automation scripts.
Automation Tools and Migration Scenarios
For large solutions with numerous projects, manual operations can become tedious. Community-developed tools offer simplification. Saveen Reddy's VS_unbind_source_control tool automatically scans solution and project files, removing all source control binding information. This tool supports command-line operations, facilitating integration into continuous integration workflows.
In TFS version migration scenarios (e.g., upgrading from TFS 2005 to 2008), complete binding removal often serves as a necessary intermediate step. This ensures solutions can be rebound to upgraded TFS servers in new environments, avoiding version compatibility issues. After migration, users can re-add solutions to source control on the new TFS server, establishing fresh binding relationships.
It is important to note that removing bindings does not affect local file content, only source control metadata. Therefore, backing up solution files before execution is recommended. For team projects, coordinating all developers to synchronize operations helps prevent conflicts from inconsistent binding states.