Stellen Sie eine Verbindung zu Visual Studio -Teamdiensten von WebService her

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Stellen Sie eine Verbindung zu Visual Studio -Teamdiensten von WebService her

by Anonymous » 27 Feb 2025, 04:06

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>

Top