tags:

views:

19

answers:

1

Hi,

I have to connecto TFS via API which already works fine when i am within my lan. But now i have to connect to a TFS over a webproxy. I am able to connect to the serverstatus.asmx via browser. I already tried to set a environment variable and added the property to app.config - but without success. Now i tried to do the same with a httpwebrequest

System.Net.HttpWebRequest request = System.Net.WebRequest.Create(tfs_uri) as System.Net.HttpWebRequest;
request.Credentials = tfs_cred;
System.Net.WebProxy p = new System.Net.WebProxy("http://proxy.local.lan:8080/");
p.UseDefaultCredentials = true;
request.Proxy = p;
System.Net.WebResponse response = request.GetResponse();

This code can connect to the tfs. If i remove proxy definition and add the defaultProxy tag into app.config - i get the same error msg when connecting a TfsConfigurationServer object. My assumption is: TFS API does not support web proxies. Is this correct?

Can somebody tell me that my assumption is wrong?

A: 

You can, but it is a bit more convoluted than just setting the proxy details. Because TFS makes lots of seperate calls under the hood you will not be able to use the methods above.

Try adapting Rido's post below:

http://blogs.msdn.com/b/rido/archive/2010/05/06/how-to-connect-to-tfs-through-authenticated-web-proxy.aspx

I would think that you should be able to integrate this method into your own applicaiton.

MrHinsh
You made my day :) thanks
mabu