0

I'm currently working in a WinForms app and using different .net client library to connect to TFS/Azure DevOps:

Microsoft.TeamFoundation.Client; Microsoft.VisualStudio.Services.Common;

and my IDE is Visual Studio 2015.

After trying to connect to TFS/Azure DevOps through diffrent methodes like:

1) Default Credentials

configurationServer = TfsConfigurationServerFactory.GetConfigurationServer(tfsUri);

or

var tpc = new TfsConfigurationServer(tfsUri);
tpc.Authenticate();

2) VssCredentials with alternate credentails activated

var winCred = new Microsoft.VisualStudio.Services.Common.WindowsCredential(
var creds = new VssCredentials(winCred);
tfsCredential.AllowInteractive = false;

var tpc = new TfsConfigurationServer(tfsUri);
tpc.Authenticate();

I noticed that only TFS Sites that were already connected to my Visual Studio IDE connected properly. It didnt matter if I added credentials or not!

~ What seams to be the problem here?

~ How can I fix it?

~ What changes when I connect my IDE to TFS that allows me afterwards to connect to TFS programatically?

riQQ
  • 9,878
  • 7
  • 49
  • 66
denpal
  • 3
  • 4

1 Answers1

1

This is more likely the credentials were stored in your Credential Manager.

You should try to remove those. Refer this blog

Also you can refer this SO to remove the cached credentials from your Visual studio.

Jayendran
  • 9,638
  • 8
  • 60
  • 103
  • Thanks for the answer. I have already done that but anyways the case is not the same. My problem is that windows credentials are always ignored. Trying to logg in with default credentails doesnt seem to work or yields that same results. So clearing the credentails wont work because I am testing with already hard coded credentails. – denpal Jan 28 '19 at 14:04
  • Can you try to login as a different user then try to run the same code in VS ? – Jayendran Jan 28 '19 at 14:19
  • I have tried with different users both cases: 1.) When I run the programm through VS Works as described above 2.) Running the application with the exe Works almost randomly for other users some pages works some dont – denpal Feb 01 '19 at 09:01