AnkhSVN not Recognizing my Solution as being in Source Control - visual-studio

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.

Related

VS2017 and AnkhSVN

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.

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.

How to use Mercurial from Visual Studio 2010?

Version Control noob alert
I've already installed both Mercurial, TortoiseHg and VisualHG into Visual Studio 2010. I've set in Visual Studio my source control to Mercurial.
When I right click on my solution, I already see HG's buttons in the context menu that appears there.
My question now is, how do I make this version control thing work? It seems I'll have to make some kind of configuration before, as it tells me "Solution is not under Mercurial version control" when I click in "HG Status".
Thanks
with tortoiseHG you can rightclick on an explorer window and do tortoiseHG -> Create Repository Here which runs hg init for you. I believe currently there is no way to run hg init from visualHG.
TekPub has a good free video for using Mercurial with TortoiseHG, VisualHG, and VS along with pushing the repository to the public via CodePlex. In it, Rob Conery shows how to create a repository in your VS solution and how to work with commits, branches, merging, etc.
It's especially good for those coming from a Subversion background because he points out how branches/merging/forking is not so challenging in Mercurial as it's been known to be in Subversion.
YouTube link as other link is dead:
https://www.youtube.com/watch?v=HV8e1NQ-8gU
Not sure how to do this within Visual Studio but it is easy to do from the command line. Just
exit VS and go to a command prompt at the root folder of the project(s) you want to put under source control and type "hg init". Then load the solution and verify that hg is the selected source code provider.

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