I put together a minimal case to test the WebClient class's default timeout.
I published a simple website to my local PC which, upon receiving a request, waits 300 seconds (long enough to make WebClient time out), and then returns a response.
I wrote a simple program which uses a WebClient to make a request to that site, and report what happens:
void Main()
{
Console.WriteLine("Starting request at " + DateTime.Now);
WebClient client = new WebClient();
try
{
string response = client.DownloadString("http://slowsite.local/");
Console.WriteLine("Response returned at " + DateTime.Now);
}
catch (Exception ex)
{
Console.WriteLine(ex.GetType() + " " + ex.Message + " at " + DateTime.Now);
}
}
The WebClient did time out after 100 seconds. The program produced this output:
Starting request at 8/1/2017 9:31:11 AM
System.Net.WebException The request was aborted: The operation has timed out. at 8/1/2017 9:32:51 AM
The client test program targeted .NET Framework 4.6.