예제 #1
0
        public string GetReleaseRevisionOfRelease()
        {
            string projectName = ClientSampleHelpers.FindAnyProject(this.Context).Name;

            // Get a release client instance
            VssConnection     connection    = Context.Connection;
            ReleaseHttpClient releaseClient = connection.GetClient <ReleaseHttpClient>();

            // Get release
            WebApiRelease release = releaseClient.GetReleaseAsync(project: projectName, releaseId: completedReleaseId).Result;

            // Get release revision
            System.IO.Stream releaseRevision = releaseClient.GetReleaseRevisionAsync(project: projectName, releaseId: release.Id, definitionSnapshotRevision: release.DefinitionSnapshotRevision).Result;
            Context.Log("{0} {1}", release.Id.ToString().PadLeft(6), release.Id);

            StreamReader reader      = new StreamReader(releaseRevision);
            string       releaseData = reader.ReadToEnd();

            return(releaseData);
        }