I'm writing an Visual Studio 2015 Extension, where i want to subscribe to some of the TFS's VersionControlServer Events. But actually none of the events getting fired. I guess i already know why, but I dont know how to get it working for my purpose. Also the documentation from microsoft is pretty poor and literally non-existend ...
The question is: Is there a way to subscribe to the events from my extension.
I've already researched many threads and couldn't find anything that is helpful for me. My code looks like this:
var tfsProjectCollection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection (TfsPath, new UICredentialsProvider ());
var tfsVersionControlServer = tfsProjectCollection.GetService<VersionControlServer> ();
tfsVersionControlServer.CommitCheckin += TfsVersionControlServer_CommitCheckin;
The problem here is , that the VersionControlServer is not the same instance that the Visual Studio uses. So if I, for example, make a shelveset, the event wont fire. Only if I would do the shelving programatically with the instance I have here, I would get the event fired.
My extension is working fine, except this issue. My extension is getting initialized on startup and subscribes during Visual Studio startup to the events. Now if I create Shelveset I would like to have the event BeforeShelvePendingChange fired.
Thanks in advance