问题
I've just got an error report from a client using a program I wrote, and I've been googling the nuts off of this error and can't find anything useful. The error is:
System.Net.WebException: Error getting response stream (ReadDone2): ReceiveFailure ---> System.Exception: at System.Net.WebConnection.HandleError(WebExceptionStatus st, System.Exception e, System.String where)
at System.Net.WebConnection.ReadDone(IAsyncResult result)
at System.Net.WebConnection.HandleError (WebExceptionStatus st, System.Exception e, System.String where) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
at System.Net.HttpWebRequest.GetResponse () [0x00000] in <filename unknown>:0
at System.Net.WebClient.GetWebResponse (System.Net.WebRequest request) [0x00000] in <filename unknown>:0
at System.Net.WebClient.DownloadFileCore (System.Uri address, System.String fileName, System.Object userToken) [0x00000] in <filename unknown>:0
at System.Net.WebClient.<DownloadFileAsync>m__F (System.Object state) [0x00000] in <filename unknown>:0
System.Net.WebException: Error getting response stream (ReadDone2): ReceiveFailure ---> System.Exception: at System.Net.WebConnection.HandleError(WebExceptionStatus st, System.Exception e, System.String where)
at System.Net.WebConnection.ReadDone(IAsyncResult result)
at System.Net.WebConnection.HandleError (WebExceptionStatus st, System.Exception e, System.String where) [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) [0x00000] in <filename unknown>:0
at System.Net.HttpWebRequest.GetResponse () [0x00000] in <filename unknown>:0
at System.Net.WebClient.GetWebResponse (System.Net.WebRequest request) [0x00000] in <filename unknown>:0
at System.Net.WebClient.DownloadFileCore (System.Uri address, System.String fileName, System.Object userToken) [0x00000] in <filename unknown>:0
at System.Net.WebClient.<DownloadFileAsync>m__F (System.Object state) [0x00000] in <filename unknown>:0
The application is the launcher program for a game, it pulls down a manifest of files and patches any which are non-existent or outdated. All the files it downloads with a WebClient object, it looks like the error is being thrown by WebClient::DownloadFileAsync, but I can't find any documentation as to why this could be happening.
Any help would be much appreciated, the quicker I can fix this monday morning the better!
Cheers Joe
回答1:
Does the client uses a proxy?
If yes, are you attaching the proxy to the WebClient
object?
Your error simply mentions that the file could not be found, DownloadFileAsync
needs a file stream, and if that's not there, you get an error...
Any thoughts in implementing a log system that can be activate through a parameter that would POST the log file into your FTP for example?
You could make use of several open source projects out there, like ExceptionReporter.
回答2:
After the sysadmin played with the server config a bit this problem seemed to go away, I'm not sure exactly what was done though.
来源:https://stackoverflow.com/questions/9454984/webclient-error-getting-response-stream