The following line of code throws an ArgumentNullException under Chrome and Firefox in silverlight. I am using HttpWebRequest to post a file to the server. The exception doesn't happen in IE and only happens when I am uploading a larger file (5mb). Under IE it works just fine. I didn't see any reason in the documentation why the code would throw this exception.
//note that asyncResult is not null
response = (HttpWebResponse)request.EndGetResponse(asyncResult);
Here is the stack trace from the exception and inner exception:
at System.Net.Browser.ClientHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)\r\n at System.Net.Browser.ClientHttpWebRequest.<>c_DisplayClass5.b_4(Object sendState)\r\n at System.Net.Browser.AsyncHelper.<>c_DisplayClass2.b_0(Object sendState)"
" at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)\r\n at System.Net.Browser.ClientHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)\r\n at DC.FileUpload.FileUpload.<>c_DisplayClassc.b_a(IAsyncResult asyncResult)"