I am developing a plugin for viewing customized change set on button click in solution explorer.
I need VersionControlServer reference for that, but I am not getting the reference if I click button from Solution explorer, But If click the button from source control explorer then it is working. But I need to call it from solution explorer/ Team Explorer.
this.m_applicationObject = _applicationObject;
this.versionControlExt = (VersionControlExt)this.m_applicationObject.GetObject("Microsoft.VisualStudio.TeamFoundation.VersionControl.VersionControlExt");
this.versionControlServer = this.versionControlExt.Explorer.Workspace.VersionControlServer;
Instead I used the url of the tfs server to get the version control explorer.
var projectCollectionUri = new Uri(TFS_COLLECTION);
var projectCollection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(projectCollectionUri, new Microsoft.VisualStudio.Services.Common.VssCredentials());
projectCollection.EnsureAuthenticated();
this.versionControlServer = projectCollection.GetService<VersionControlServer>();