I try to create a web test using proxy, and the following codes are working in VSTS 2005, but it is not working in VSTS 2008. I got the following error:
Request failed: No connection could be made because the target machine actively refused it IP Address:80
During 1 day search and I find one clean machine to repro, I find the problem .
VSTS 2008 RTM has the bug related to webtest and proxy. That's why it failed in VSTS 2008 RTM , but passed in VSTS 2005.
Because VSTS 2008 SP1 Beta is still in beta version, usually people don't install it. If they don't install it, it means this web test and proxy will not work forever.
After I installed it and ran the test again, the web test passed.
public class WebTest3Coded : WebTest
this.PreAuthenticate = false;
credential = (NetworkCredential)CredentialCache.DefaultCredentials;
WebProxy proxy = new WebProxy("126.96.36.199", 80);
proxy.Credentials = credential;
this.WebProxy = proxy;
public override IEnumerator
WebTestRequest request1 = new WebTestRequest("http://www.microsoft.com/");
yield return request1;