I wrote a small Winform program that connects to TFS. My problem is that i always succeed to connect to TFS, even when i write the wrong credentials, still, in debug mode i see that my actual credentials are used.
I saw a similar question here and did exactly as suggested, deleted my TFS credentials from Credential Manager, still no luck(Yes, i did exit and re-open VS). I also logged out ot TFS itself and removed the connection on visual studio. Also, i deleted the cache folder as suggested here.
my code looks something like that:
folderPath=@"$/TFS_PATH";
cred = new NetworkCredential(ConfigurationManager.AppSettings["user"], ConfigurationManager.AppSettings["pass"]);
tfs = new TeamFoundationServer("CollectionPath", cred);
tfs.EnsureAuthenticated();
MessageBox.Show("tfs.EnsureAuthenticated() succeeded");
Some explantions for the code:
cred is an instance of NetworkCredential
tfs is an instance of TeamFoundationServer
The username and password are in app.config. Somehow, it completely ignores it, and uses my real credentials.
Does anyone know what else can i do? My goal is to enable the TFS connection from any computer/server by the username and password that are stored in app.config ONLY, not depend on the credentials that are stored on the machine iteself already.
Thanks