Exemple #1
0
        public TfsRelease(TfsInfo TfsEnvInfo, string pat)
        {
            this.TfsEnvInfo = TfsEnvInfo;

            // Use PAT in order to perform rest calls
            VssConnection connection = new VssConnection(new Uri(this.TfsEnvInfo.ProjectCollectionUrl), new VssBasicCredential(string.Empty, pat));

            relclient  = connection.GetClient <ReleaseHttpClient>();
            projclient = connection.GetClient <ProjectHttpClient>();
        }
Exemple #2
0
        public TfsRelease(TfsInfo TfsEnvInfo)
        {
            this.TfsEnvInfo = TfsEnvInfo;

            // Interactively ask the user for credentials, caching them so the user isn't constantly prompted
            VssCredentials credentials = new VssClientCredentials();

            credentials.Storage = new VssClientCredentialStorage();

            VssConnection connection = new VssConnection(new Uri(this.TfsEnvInfo.ProjectCollectionUrl), credentials);

            relclient  = connection.GetClient <ReleaseHttpClient>();
            projclient = connection.GetClient <ProjectHttpClient>();

            client             = new WebClient();
            client.Credentials = credentials.Windows.Credentials;
        }