Friday, July 5, 2013

VS 2012 keeps prompting to switch to AnkhSVN source control when opening a project checked out from Team Foundation Server

We moved a C# project that was formerly under SVN to TFS. After the inital checkout from TFS to a clean local Folder, Visual Studio kept prompting to switch to AnkhSVN. Even after setting source control to TFS manually in VS, the message kept being displayed on opening the project.

How-i-fixed-it:

I found the solution here (thanks to Haddicus):

http://msdn.microsoft.com/en-us/library/fy98ye1k%28v=vs.90%29.aspx

How to (Really): Switch Source Control Plug-ins
Although you can do as the article suggest, you may find yourself in an infinite loop. The source control system will tell you (when you select a new source control option) that the current project uses a particular control system. If this is so, it will force close you out of the project itself. In my case, at least, the source control selection was hard coded into my primary project file, and wouldn't let me switch source control.

What you'll want to do to change this is to close your solution, and open up the solution file in a text editor. Look for a global section area, this area defines the version control software. For me to change providers, all I needed to do was remove this section (everything in the GlobalSection node)... For me ( I was using Subversion with AnkhSVN), so I removed this entire block:

    GlobalSection(SubversionScc) = preSolution
        Svn-Managed = True
        Manager = AnkhSVN - Subversion Support for Visual Studio
    EndGlobalSection

No comments:

Post a Comment