Take the 2-minute tour ×  Problem: This console app calls a long
running webpage hosted on Azure twice. I want it to call it only
once.  The console app fails with a caught exception: The
underlying connection was closed: An unexpected error occurred
on a receive. so question  If I call the page from Chrome, it
runs once (as expected)  public class ExtendedWebClient :
WebClient     public int Timeout { get; set; }      protected
override WebRequest GetWebRequest(Uri address)
HttpWebRequest request =
(HttpWebRequest)base.GetWebRequest(address);         if (request
!= null)             request.Timeout = Timeout;
request.KeepAlive = false;         request.ProtocolVersion =
HttpVersion.Version10;         return request;      public
ExtendedWebClient()         Timeout = 1000000; // in ms.. the
standard is 100,000  class Program     static void Main(string[]
args)         var taskUrl =
"http://secret.net/SendWeeklyEmails.aspx";         // create a
webclient and issue an HTTP get to our url