Stellen Sie eine Verbindung zu Visual Studio -Teamdiensten von WebService herC#

Ein Treffpunkt für C#-Programmierer
Anonymous
 Stellen Sie eine Verbindung zu Visual Studio -Teamdiensten von WebService her

Post by Anonymous »

Wie kann ich Anmeldeinformationen für tfSteamProjectCollectionFactory.getTeamProjectCollection < /code>? < /p>

Ich habe es so versucht < /p>

Uri tpcAddress= new Uri("https://myserver.visualstudio.com/DefaultCollection");
TfsConnection tfsc = new TfsConfigurationServer(tpcAddress,
new NetworkCredential("[email protected]", "password"));
TfsWebClient wc = new TfsWebClient(tfsc);
tfsc.Connect(ConnectOptions.IncludeServices);
< /code>

Zweitens versuchenICredentialsProvider prov = new myCredentials();
var tpc = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(tpcAddress, prov);
tpc.EnsureAuthenticated();
tpc.Authenticate();

public class myCredentials : ICredentialsProvider
{
public ICredentials GetCredentials(Uri uri, ICredentials failedCredentials)
{
return new NetworkCredential("[email protected]", "password");
}
public void NotifyCredentialsAuthenticated(Uri uri)
{
}
}
< /code>

Aber es funktioniert nur in meinem Computer, da ich bei TFS angemeldet bin. < /p>

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post