I'm trying to invoke a web page, by using HttpWebRequest, however I'm getting "the operation has timed out error".
string sURL = "http://localhost:53667/MyPage.aspx";
WebRequest wrGETURL = WebRequest.Create(sURL);
wrGETURL.Timeout = 5000;
System.Net.ServicePointManager.DefaultConnectionLimit = 5000;
var r = wrGETURL.GetResponse();
r.Close();
wrGETURL.Abort();
As you can see I added the DefaultConnectionLimit property, closed the response as other threads suggested, but that didn't seem to do it. What am I doing wrong?
Edit:
When I use the full example from: http://support.microsoft.com/kb/307023, running/debugging it from Visual C# as a console app, it doesn't time out. When I set this program to run on Windows Task Scheduler, it does time out.