I am having the same problem switching between Team Foundation Server and VisualHg. I have observed the following pattern:
- If VS starts with anything else than VisualHg as SCC, VisualHg is not automatically used on Mercurial projects.
- If VisualHg has been activated at least once while VS is running it will work until VS is shut down, even when you switch between Mercurial and TFS solutions.
This suggests that VisualHg is not loaded or does not get informed about VS activities until it has been manually activated (or is active SCC at startup).
I have further downloaded the source code and run some debug sessions on it, watching the debug output. These confirm the above observations and specifically I find that the OnAfterOpenSolution event is not received until VisualHg has once been active.
I am not familiar with the intricacies of VSX but I wonder if there could be an issue that since VisualHg is a SCC it is not hooked up until it is requested? If that is the case then the self-activation inside VisualHg is never called until it has once
been activated and hooked up. Maybe the self-activation of VisualHg needs to be in a separate extension that is not a SCC and hence is always hooked up? Something to think about...