I have a console app, which include a (new WebClient()).DownloadFile(source,target) (shortened for brevity).
I’m running is on a windows 2003 server, over rdp.
When the server is locked (it locks after a few mins of not beining used) the program just stops running, it just crash or anything, it just doesn’t progress any further.
Console.WriteLine("Downloading to {0} ...", localTempFile);
sw.Start();
Client.DownloadFile(url + "/" + fileName, localTempFile);
sw.Stop();
Console.WriteLine("{0} | Done in {1}s",DateTime.Now,sw.ElapsedMilliseconds / 1000);
I really don’t know where to start with this problem, there is nothing complex going on, it is just a simple linear console app. Any ideas?
Firstly you need to establish if this happens with not only
WebClient.DownloadFilebut with other programs, do this by writing a quick program that maybe prints out the time.The next thing would be is your code reffering to the active Window in anyway that would cause it to stop? When the computer is locked there is no active window.
Another scenario could be one of your services disables when the computer is locked causing WebClient to stop processing, maybe a network policy or something.
I hope this helps.