How to Permanently Remove TFS Source Control Bindings from Visual Studio Solutions (VS2012)

I often have the need to distribute Visual Studio source code to external parties. Internally this source code is under source control in Team Foundation Server (TFS).

It would be nice if you could just take a copy of the source files and remove the source control binding (in Visual Studio). Unfortunately I haven’t found a way to be able to do this. Even when Visual Studio says that all bindings have been removed, if you try to open up the solution you get an error message along the lines “The solution you are opening is bound to source control on the following Team Foundation Server …”

image

Under earlier versions of Visual Studio I had used Visual Source Safe for source control and had used a utility called VSSBindingRemover which did the job quite effectively. It removed all source control files with the solution and project directories and modified the solution and project files themselves to remove source binding information.

My search for a similar tool for Visual Studio 2012 / TFS resulted in a utility available on CodePlex called VSUnbindSourceControl.

The process for removing bindings is simple:

  • Ensure you don’t have the solution/projects open in Visual Studio
  • Copy your solution to a new directory (because the tool does modify files)
  • Run the utility from the command line: VSUnbindSourceControl.exe d:\mysolution folder

Once the tool is finished, all the source control bindings have been removed from any solution and project files.

About these ads

About Cameron Dwyer

Architect and developer of @OnePlaceMail. Passionate about delivering compelling solutions on the SharePoint platform. Addicted to coffee.

Posted on November 7, 2012, in C# and tagged , , , , , , , . Bookmark the permalink. 4 Comments.

  1. Thanks for this. Wish I had found this earlier.

  2. Utility was buggy for me, other people say same on comments. I succeeded by removing the TFS Source Control specific files, e.g. *.vsccc (or whatever they are) and then removing the following section from each project file:
    GlobalSection(TeamFoundationVersionControl) = preSolution
    SccNumberOfProjects = 2
    SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27XXXXX}
    SccTeamFoundationServer = https://xxx.xxx.com/defaultcollection
    SccLocalPath0 = .
    SccProjectUniqueName1 = CrossXXXX\\CrossXXXX.dtproj
    SccProjectName1 = CrossXXXX
    SccLocalPath1 = CrossXXXX
    EndGlobalSection

  3. ha whooops that was dumb! Please reject or remove the tfs/project identifying info from my previous comment before approving. Thanks. Doh!

  4. Thanks! This saved me some time and frustration with one of the projects.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 88 other followers

%d bloggers like this: