How to configure Visual Studio to use different source control providers - visual-studio-2010

I'm involved in many projects and each project has their own source control provider. Is there a way to configure Visual Studio 2010 to automatically select the right source control on a per project basis? Or is the Tools - Options - Source Control plug in per user level?
Let me clarify what is happening. I have a project using Vault. When I open it VS sets the Source Control to Vault. I then close the project (solution) and open another solution that uses Mercurial (VisualHG) I check the Source Control plugin and Vault is still selected. Why? Is it possible to automatically select the right source control?

In order to automatically load a proper source control provider the solution file must contain Scc bindings.
I don't know if VisualHG supports them or not.
But you can try HgSccPackage - another mercurial plugin for MS Visual Studio 2008/2010 which supports Scc bindings.
You can get it here: http://www.newsupaplex.pp.ru/hgscc_news_eng.html
If you want to add Scc bindings to an existing controlled solution, use Mercurial -> Change SCC bindings menu from the IDE. (This menu will be available when the HgSccPackage is active and you have loaded a controlled solution).
For new projects HgSccPackage automatically adds Scc bindings. It is configurable via options though, for thouse who don't like this behavior.

You might want to take a look at this question. It appears the answer is no, you have to select the correct provider for the project before working with the project, because only one source control provider can be active at a time.

There's an additional VS plugin called Scc Auto Switcher that can help automatically switch between SCM systems used by different projects, although the docs don't specifically mention Vault.

Related

How can I disable creation of source control in TFS 2010 when creating a new Team Project?

I've searched MSDN and this site (as well as a pile of web searches) and not found anything obvious ... I do see a similar question here about using an existing source control folder -- and the note that TFS apparently stores some project settings there (and thus needs one whether you use it or not).
We're using a non-TFS source control tool -- and I don't want newcomers "accidentally" storing source versions in TFS. So, I'd like to disable the creation of a TFS 2010 source control "tree" when I create a new Team Project in VS 2010.
There may be other solutions to this problem, though, and I'm open to suggestion. For example, if TFS really does need to store some internal data -- how about a way to simply prevent any source code checkins (that is, let TFS use the source control project as needed, but prevent users from adding files)?
TFS has extensive permissions settings.
You should be able restrict check in / access to source tree by permission.

How to specify the source control plugin on a per-solution basis in Visual Studio?

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.
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.
Source control provider auto switching based on reserved directory presence can be done with a VS extension as described here.

Is it possible to create a new Team Project from Source Explorer in TFS?

We are using Team Foundation Server 2010 for source control only. We don't really use the application lifecycle management aspects of it.
Therefore, we pretty much live in Source Explorer. What I find annoying is that I can't create a new project from there, but instead have to open Team Explorer and go through the wizard there to create a top level folder.
I'd like to know if there is someway to skip the Team Explorer step and just create a top level project quickly (default settings), preferably from Source Explorer.
Thanks!
If you are looking for a way to achieve this via VStudio, I think you are out of luck.
It's possible to construct programmatically a TeamProject, check here if this fits your needs.
No, I don't believe you can create a new team project from Source Control Explorer.
However, you can do it from the command-line, or using the power tool.

Integrate Visual Source Safe with Visual Studio without using source control binding

Is there a way to integrate Visual Studio with VSS without doing source control binding?
The problem I have is that my team is opposing to add source control binding to the solution and project files, since they claim it adds more problems (restrictions) for them.
On the other hand, I really like to perform most of the source control operations from Visual Studio.
Is there any way to have the solution file and all the project files the way they are (without added binding to VSS) and still have VSS and VS integration without forcing other team members to use that integration.
I don't see a way to do it per project.
You can however you do it for IDE (all projects loaded).
It is under Tools\Options\Source Control
and then set Binding to None.
I see it in VS 2005 and 2008. I gave it a try in a project I wanted to convert from VS2005 to 2008 and appeared to work (I did not want to check in/out files for conversion).
The answer to your question is "no." Bindings and VS integration are one & the same with SourceSafe. I'm not even sure what it would mean for a solution to be integrated but not bound, or vice versa. What exactly are your teammates looking for?
You can adjust bindings per-project in the File -> Source Control -> Change Source Control dialog. You can also adjust them per-user (effectively; not a supported configuration) by excluding the *scc files from source control. However, you are likely to encounter problems down the road if you try to manage these files yourself instead of using the Add Solution To SCC wizard. More info:
http://alinconstantin.dtdns.net/WebDocs/Scc/_Bindings.htm
http://alinconstantin.dtdns.net/WebDocs/Scc/_WebEnlist.htm
The binding is stored in the .vssscc, .vspscc and MSSCCPRJ.SCC files.
If you don't add these files to Visual Source Safe every developer can configure his bindings like he wants.
Since we use Perforce, I'm not 100% sure if this works with VSS.

Can Perforce and SourceSafe co-exist in Visual Studio?

Visual Studio 2008, to be more specific. We're testing out moving to Perforce for source control, so I'd like to install the P4SCC plugin to monkey around with. However, I'd also like to continue using SourceSafe's IDE capabilities for projects that haven't been moved over yet. Can the two co-exist peacefully, or is it one or the other for a specific install of VS?
Yes, Visual Studio supports multiple providers. The entire VS architecture is plugin based, and SCC providers are just another kind of plugin (usually implemented as a "package," in VS terminology).
You can only have one SCC provider active at a time. So you cannot have different projects bound to different providers within the same solution.
The active SCC provider can be switched by:
Going to Tools -> Options -> Source Control (present as of VS 2005) -or-
Using a tool like SccSwitcher to modify the registry directly (needed on VS 2003 and earlier)
Opening a solution that already has SCC bindings written into it
You cannot change the provider from within the Bind dialog (File -> Source Control -> Change SCC). All you can do there is bind/unbind, or in the case of a few odd providers like SourceSafe, edit the server path.
To change the provider of an existing solution you would use the Bind dialog to remove the existing bindings, change the active provider from Tools -> Options (or SCCSwitcher if needed), then launch the Add Solution To Source Control wizard from Solution Explorer.
Visual Studio can handle multiple source control plugins/systems, but you'll need to be sure that your projects are bound to the correct provider (File->Source Control->Change Source Control).
I use:
SCC Switcher
to help me with this. It's handy as it gives you a traybar icon for switching.
I would also recommend TraySource its the same as SCC Switcher
I reguarly have to switch between Perforce and Source Safe and found this to be ideal for it

Resources