HttpWebRequest Aborting After Callling GetResponse()
<p>I have a situation driving me crazy and there isn't any real information online that's helping.</p>

<p>I am automating a manual process for uploading a file. I actually wrote this code like 3 years ago and it worked without a hitch for a year, now it fails intermittently. In looking at the Fiddler traffic for my requests and requests just made from a browser the only differences I see are that in fiddler I get this red circle with a line through it twice during my automated calls.</p>

<p>My research indicates this icon means the client aborted the session - which I did not do. I pass the same CookieContainer object with each request. I don't know why this is happening but if I view the properties of the logged line in Fiddler it says this for my automated requests:</p>

<pre><code>SESSION STATE: Aborted.
...
X-ABORTED-WHEN: SendingResponse
...
== TIMING INFO ============
ClientConnected:    16:25:58.563
ClientBeginRequest: 16:25:58.566
GotRequestHeaders:  16:25:58.567
ClientDoneRequest:  16:25:58.567
Determine Gateway:  0ms
DNS Lookup:         0ms
TCP/IP Connect: 0ms
HTTPS Handshake:    0ms
ServerConnected:    16:25:58.207
FiddlerBeginRequest:    16:25:58.567
ServerGotRequest:   16:25:58.567
ServerBeginResponse:    16:25:58.922
GotResponseHeaders: 16:25:58.922
ServerDoneResponse: 16:25:59.268
ClientBeginResponse:    16:25:59.268
ClientDoneResponse: 16:25:59.268
</code></pre>

<p>The same line from the log I get with the browser looks like this:</p>

<pre><code>SESSION STATE: Done.
...
ClientConnected:    10:33:09.347
ClientBeginRequest: 10:33:11.982
GotRequestHeaders:  10:33:11.982
ClientDoneRequest:  10:33:11.982
Determine Gateway:  0ms
DNS Lookup:         0ms
TCP/IP Connect: 0ms
HTTPS Handshake:    0ms
ServerConnected:    10:33:08.050
FiddlerBeginRequest:    10:33:11.982
ServerGotRequest:   10:33:11.982
ServerBeginResponse:    10:33:12.337
GotResponseHeaders: 10:33:12.337
ServerDoneResponse: 10:33:12.511
ClientBeginResponse:    10:33:12.511
ClientDoneResponse: 10:33:12.514
</code></pre>

<p>So "Done" vs. "Aborted". I never called Abort on the request and I'm not getting any exceptions at all. Here is my code where the abort occurs:</p>

<pre><code>using (WebResponse httpResponse = httpRequest.GetResponse())
{
    if (!httpResponse.ResponseUri.AbsoluteUri.Equals(string.Format("{0}main.htm", url), StringComparison.CurrentCultureIgnoreCase))
    {
        throw new Exception("Log in failed. Check the Username and Password information in the Setting table.");
    }

    httpResponse.Close();
}
</code></pre>

<p>I have tried taking away the "using" (even though it's recommended) and the "Close" (also recommended) and it still gets aborted.</p>

<p>I appreciate it</p>
