Can Perforce and SourceSafe co-exist in Visual Studio? - 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

Related

How do I remove a custom tool from visual studio?

I've installed the protobuf-net ProtoBufTool custom tool into visual studio to automatically generate .cs file from protocol buffers files. I want to be able to build my project using msbuild for continuous integration and have moved over to using a python script to generate the files.
So how do you remove a custom tool from visual studio?
I've removed it from Documents\Visual Studio 2010\Templates\ItemTemplates\Visual C# which is where I installed it. I've searched for it in the registry and the GAC. I've tried removing it from the file properties in VS and it keeps coming back. I don't want to nuke my machine from orbit!
Edit: I've found the correct registry key now to disable the tool (see Clearing Custom Tool file property in Visual Studio 2010) but I'd still be interested to know if there's a better workflow for managing custom tools
May be you can try:
Tools -> Add-in Managers
Tools -> Extension Manager
"Tools -> External tools" menu can help you.
As Marc pointed out there's a perfectly good uninstaller for just this situation.

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.

How to configure Visual Studio to use different source control providers

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.

Is it possible to have mixed source control providers in a VS2010 solution?

Currently most of the development in the company I work for is controlled via VSS. I've installed Team Foundation Server for the development at our site.
There is a future project that will involve new developement, but referencing older code bases hosted in VSS. My preference would be to use TFS for the new development, but I'm unsure if a VS2010 solution can have projects using different source control providers.
You'll need to change the source control provider manually (unbind - change SCC provider - bind) each time.
No Visual Studio does not allow for mixing source control providers within a solution at the same time.

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.

Resources