Why does the following code Timeout the second (and subsequent) time it is run?
The code hangs at:
using (Stream objStream = request.GetResponse().Ge
As you have stated, running fiddler in the background would mitigate the issue. This is because fiddler force closes any responses. Extending on the above post from Sam B I would ensure that the response is closed like so:
using (var wresponse = request.GetResponse())
{
using (Stream objStream = wresponse.GetResponseStream())
{
// ...
}
wresponse.close();
}
Also it may be worth setting the proxy to null like so:
request.Proxy = Null;
As the .NET framework will go out searching for a proxy unless you explicitly do this. When fiddler is running this effect would be mitigated as fiddlers proxy would be found directly.