VS2017 and AnkhSVN - visual-studio

My solution is detected properly by AnkhSVN running in VS2015 to be bound to SVN. For some reason, if I open this same solution in Visual Studio 2017, AnkhSVN doesn't see it bound to SVN. I try to bind it, for some reason VS2017 binds it to GIT. Not sure why that is. What is the proper way to fix this issue? or how do I re-bind it again to SVN so that AnkhSVN sees it as bound?
P.S. This doesn't happen in all my solutions, just a few. Not sure what is so special about those solutions. Did diffs but I don't see anything special about those solutions. Any ideas?

Seems the way to fix this is to go to
"Tools - Options - Source Control", and select AnkhSVN as the active SCC Provider.
This seems to be on a per solution basis and it makes some change in the solution file because it works from then on.

Related

Does Resharper 5.1 Refactor (Refactor->Move) Correctly Notify AnkhSVN/maintain SVN history?

My dev environment is Visual Studio 2010, with Resharper 5.1.3000.12 and AnkhSVN 2.1.10129.17 installed.
It's my understanding that Resharper should notify AnkhSVN (or VisualSVN, etc) when a Refactor->Move command is done on a file, to maintain the SVN history on the file. However, when I do such a refactor through the Solution Explorer in Visual Studio, AnkhSVN treats the file move as a delete/add, thus losing the SVN history for that file. In fact, Ankh doesn't even add the new version of the file, it just deletes the old one, and I have to manually "add" the new one before I can commit.
HOWEVER, if I do a Ctl-X,Ctl-V through the Solution Explorer to move the file, Ankh detects it as a copy/move and maintains the history, auto-adds the new file, and generally behaves as one would expect.
Does this work for anyone else, and if so, did you have to do anything tricky to get it to work? Have I missed a setting somewhere to wire up AnkhSVN with Resharper, do I perhaps need new versions of either plugin, or perhaps this is some kind of installation order problem? (I installed Resharper first, then Ankh).
A certain amount of work has been done during ReSharper 6 release cycle to make sure that ReSharper's Move refactorings resulted in VCS moving them instead of deleting and adding new files.
However, as there has been no comprehensive QA for this piece of functionality, it has not been announced as a part of ReSharper 6 set of improvements.
In other words, there's no guarantee that ReSharper 6 will behave better in your scenario but it's worth a try upgrading.
Accordingly to the Jetbrains task tracker, it's still not fixed. You may track it here: http://youtrack.jetbrains.com/issue/RSRP-179384.
Issue is related to TFS but it's also reproducible with AnkhSvn in VS Professional 2012.
ReSharper version: 7.1.1 C# Edition (Build 7.1.1000.900)

How to quickly switch source control providers in Visual Studio 2010?

I'm currently working on .Net projects that are using either Git or Mercurial (Hg) source controls. I use Visual Studio 2010 for all of these projects. As I often have to switch source control providers I was wondering if there's a quick way to do this, so I don't have to go Tools -> Options -> Source Control once an hour.
A much better solution would be if Visual Studio would recognize which source control provider it needs or maybe remember which provider was used for a certain project. Can that be done?
With a nudge in the right direction I managed to handle this problem even better then expected - no switching necessary.
For Mercurial solutions I use VisualHG and for Git I use Git Source Control Provider. I also installed HgSccPackage. Now I don't really know how or why this works, but I've got GitSCC selected as the Source Control Provider in the settings, but when I load a Mercurial project VisualHG takes over. All I have to do is set the SCC to VisualHG the first time I open the project, close the project, change back to GitSCC and when the project is reloaded VisualHG will be used for it.
Interestingly it does not work without HgSccPackage installed. If someone can explain this, please do.
Note that it does not seem to work the other way round.
I use Git in combination with VS 2010 by keeping a commandline screen open. I do my work in Visual Studio and when I'm ready to make a commit, I switch to the commandline screen.
If you do this, you can use Git and Mercurial side by side in combination with VS 2010.

AnkhSVN not Recognizing my Solution as being in Source Control

I did not go the route of using the ankhSVN context menu in VS to add my solution to SVN. I went the route (because I prefer to and like how tortoise does this) of using Tortoise to add my folder/project to SVN for the first time.
Then when I opened that solution, VS opens but ankhSVN still did not flag my files or recognize a connection to svn.
what's the deal? I don't want to be forced to only use ankhSVN to commit a project for the first time to SVN in order for ankhSVN to bind or recognize and kick in.
Most likely, AnkhSVN isn't loaded yet at this point. Go to Tools - Options - Source Control, and select AnkhSVN as the active SCC Provider. Then go to File - Subversion - Change Source Control, and connect/bind the solution. This causes Ankh to be loaded the next time you open the solution by annotating the sln file. Other people checking out the same sln file also benefit from this, because Ankh is then loaded directly.
The times I had this issue it was because SVN was updated and ankhSVN didn't support the type. I fixed this by either rolling back the SVN update or install the lastest version of ankhSVN which sometimes is the beta version.
I had the same problem, usually this fixes it:
Right click on the solution node of the Solution Explorer. In the context menu, go to Subversion... Refresh Status.
Or as Stefan points out, just use the Ankh toolbar in Visual Studio.

Why does Visual studio 2005 prefer "none" instead of perforce as source control provider

(Formerly: Help! Sourcesafe hijacks Perforce bindings in visual studio 2005)
Hi,
I'm currently having a problem with a visual studio solution. We're using perforce as our source control provider through the binding mechanism in visual studio.
My problem is that every time I open the solution sourcesafe will hijack the bindings and show me lots of errors about not being able to find the sourcesafe database.
This problem is easily corrected by:
Unbinding the solution and all projects.
Go to options and change source control provider from sourcesafe to perforce.
Rebinding the solution and all projects.
But! I don't want to do this every time i open the solution.
Does anyone her know what's going on here? I preferrably want to fix this without removing the sourcesafe plugin altogether.
Update:
I have removed some registry entries to keep VS from discovering the sourcesafe plugin. This works since sourcesafe no longer can be found in the list of providers in the options. The funny thing is that it still won't use perforce. When I open the solution I still get the errors and the provider is set to "none" in the options dialog.
It seems that this is not a sourcesafe problem, but a visual studio problem. Does anyone know where visual studio stores its bindings on a project and solution level? I have checked the .scc and .vssscc files and found no mention of perforce. (Other than project name: "perforce project")
regards,
Yngve
Visual Studio supports only 1 Source Control at once, so you need to switch providers through options BEFORE you open the solution. (open VS, switch providers, open solution).
After a lot of digging, in the registry as well. I found a little list of source control providers under the following key:
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\SourceControl\EngineNames]
"0"="Sourcesafe"
"1"="Perforce"
After changing the order to:
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\SourceControl\EngineNames]
"0"="Perforce"
"1"="Sourcesafe"
it correctly associates the projects with perforce. Why, you ask? I have no idea whatsoever.
Whether or not this "fix" will mess with any bindings to sourcesafe remains to be seen though.

Can You Use AnkhSVN and VisualSVN at the Same Time?

I'd like to try out a feature of AnkhSVN (namely, integration with Red Gate SQL Changeset tool) without doing an complete uninstall of VisualSVN. It feels dodgy, so I wanted to see if anyone else had experience that would either alleviate or confirm my fears.
Update
So I tried uninstalling VisualSVN and dropping in Ankh. As far as working within VSS itself, the change was completely transparent. Sadly, SQLChangeset did not work with this plugin, so that part of it was in vain.
Switching back was also painless, even to the point of not having to re-enter my license. So, good knowledge but no joy on the long-term goal.
Sort of. I've been able to install VisualSVN and AnkhSVN on Visual Studio at the same time. However, you won't be able to use both at the same time. VisualSVN is an add-in, while AnkhSVN is truly a source control plugin. To use one or the other, you simply have to disable source control binding (for AnkhSVN) or disable the plugin (for VisualSVN).
In my experience, though, I've found that VisualSVN was a much better client than AnkhSVN. VisualSVN handles ignoring user files (*.suo) and adding projects to Subversion very efficiently. AnkhSVN on the other hand, caused me some difficulty.
Hope this helps!
I haven't tried it, but I know Visual Studio supports multiple source control plugins. You just pick which one is active from the options by choosing Tools->Options from the menu and then finding the Source Control->Plug-in Selection page in the tree control on the left side of the window that opens.
It should just be a matter of installing Ankh and selecting it there for your tests, then setting back to VisualSVN when done. Of course, that assumes everything plays nice together.
You might be able to turn off / disable VisualSvn in Tools -> Addin Manager, and then select AnkhSvn as the current SCC Provider.
Can you describe how this changeset tool works, and how that should integrate with AnkhSvn?

Resources