16

When trying to switch my solution from using Ankhsvn to VisualHG (we've just migrated from SVN to Mercurial) I kept getting the following message:

"The active solution or project is controlled by a different source control plug-in than the one you have selected. If you change the source control plugin, the active solution or project will be closed. Do you wish to continue?"

The solution would then close and when I re-opened it it would still be linked to Ankhsvn.

I tried deleting the source folder and grabbing a fresh clone out of Mercurial, but the problem kept coming back.

Mike Parkhill
  • 5,511
  • 1
  • 28
  • 38

3 Answers3

32

The solution required opening the .sln file in a text editor and manually removing the following block:

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

After that I was good to go.

Mike Parkhill
  • 5,511
  • 1
  • 28
  • 38
  • 1
    @Neolisk Trick is worked! after removing this element from sln go to tools-> source controls -> change the provider to TFS. then re-open the solution – ari Feb 09 '16 at 13:34
0

The above solution works but another way to do it without editing the sln is to open the project instead of the solution. Then change the setting at Tools->Options->Source Control->Plug-in Selection and change plug-in. Make sure you save all - this should save the new Source control to the solution.

Aman
  • 133
  • 1
  • 9
  • 2
    These are the exact steps I'm taking that *make* the message come up in the original question. Definitely not a solution. `... If you change the source control plug-in, the active solution or project will be closed.` – Chad Apr 21 '17 at 19:11
  • If you opened a solution yes it will close - if you opened the project it doesn't close. I just tested it. Remember the project is inside the solution, it closes the sln because you are editing the current open solution. So the trick is to not open the solution - open the project, then it writes into the unopened solution. Note that this works usually with only one project in the solution. – Aman Apr 22 '17 at 18:45
0

My solution is:

  1. open solution normally with vs
  2. disconnect all AnkhSvn project bindings
  3. change source control plugin to VisualHG and save all
user2448451
  • 287
  • 3
  • 3