52
votes

I just installed AnkhSVN to have subversion support from within Visual Studio 2010. I noticed I had to go to Tools > Options > Source Control to select the current source control plugin.

At the moment, I'm working on multiple projects using different version control systems. For instance, I also have some projects in Mercurial, for which a VS source control plugin is available.

Is there any way to specify the source control plugin on a per-solution basis? Or can VS detect the used vcs automatically? What are the best practices in this respect?

Edit: a google search led me to How to configure Visual Studio to use different source control providers and Can Perforce and SourceSafe co-exist in Visual Studio?. Both cover the same ground, but appear to be specific to specific vcs and lack a satisfying general answer. I'm looking for a general answer here.

2
+1 as I have the same issue switching from TFS and Perforce.Fueled
Seems like the linked references more or less answer the question. If the source control plugin used by Visual Studio for a particular source control system supports source control integration bindings then they will be recorded in the solution file. Visual Studio should utilize those bindings when it opens up the solution to select the appropriate source control provider.Matt Glover
I do not thing that is possible unless you install some plug in that will do this for you.cpoDesign
SVN and GIT are probably the pair most people switch between.dotNET

2 Answers

31
votes

There is unfortunately no good answer here. You will simply have to go in and manually change you visual studio source control provider settings before you open the project. This is a limitation of how this particular plugin system works, and will probably take a new version of visual studio to specifically address it.

This is an instance where visual studio works better for the enterprise shop with standardized source control tools, and not as good for a contractor working with multiple clients across an array of technologies.

7
votes

Source control provider auto switching based on reserved directory presence can be done with a VS extension as described here.