IO Exception: Cannot close stream until all bytes are written

A

Al Cadalzo

I'm getting this error In DEBUG mode with 'Break into the debugger' option
turned on I get an IO
Exception:
'Cannot close stream until all bytes are written.'
Followed by a 'WebException':
The RemoteServer returned an error (500) Internal Server Error.
at System.Net.HttpWebRequest.CheckFinalStatus()

I'm using VS.Net v7.1.3052

I'm using WebClient to do a POST:
Here's a code snippet:


(C#)

Byte[] responseArray = null;
try
{
responseArray = _webClient.UploadData(_curURL, "POST", byteArray); <<
Exception occurs here.
_curPage = System.Text.Encoding.ASCII.GetString(responseArray);
}

Any ideas?

Thanks,
Al
 
A

Al Cadalzo

Natty,

The problem is that I do not know how to debug the page.
On one execution it will fail, then I will rerun it and it will succeed and
I will get the page returned.
I would say it fails about 70% of the time.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top