locked
How Can I Get The VersionControlServer class in Plugin. RRS feed

  • Question

  • Hello, 

    I implemented Custom Checkin Policy and Custom Plugin.

    Inside Plugin, I need to get merge candidates between two branch in plugin subscriber. 

     --- I could get in my TestConsole app with following usings. 

    using Microsoft.TeamFoundation.Client;
    using Microsoft.TeamFoundation.VersionControl.Client;

            var tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("http://srvtfs:8080/tfs"));
            var versionControl = tfs.GetService<VersionControlServer>();
            var list = versionControl.GetMergeCandidates("BranchA", "BranchB", RecursionType.Full);
            Console.ReadLine();


    In plugin I realized that the IVssRequestContext provide a method which can bring the services. But I do not know which service should I get to get merge candidates between two branch.

            public EventNotificationStatus ProcessEvent(
                IVssRequestContext requestContext,
                NotificationType notificationType,
                object notificationEventArgs,
                out int statusCode,
                out string statusMessage,
                out ExceptionPropertyCollection properties)
            {
                var returnObject = EventNotificationStatus.ActionPermitted;

                statusCode = 0;
                statusMessage = string.Empty;
                properties = null;



    Monday, January 6, 2020 6:54 AM