Re: The underlying connection was closed: An unexpected error occurred on a receive.
Okay I think I might have a solution. A while ago I Google my issue and I needed to add this code to my References.cs. Do you know where that file is located at?
Code:
protected override WebRequest GetWebRequest(Uri uri)
{
HttpWebRequest webRequest = (HttpWebRequest) base.GetWebRequest(uri);
webRequest.KeepAlive = false;
webRequest.ProtocolVersion=HttpVersion.Version10;
return webRequest;
}
Heres a link that talks about it: http://geekswithblogs.net/denis/arch.../16/50365.aspx
Re: The underlying connection was closed: An unexpected error occurred on a receive.
Quote:
Originally Posted by
kytro360
Okay I think I might have a solution. A while ago I Google my issue and I needed to add this code to my References.cs. Do you know where that file is located at?
If you don't have a web service proxy, then you won't have a references.cs file.
You don't need to add this method, all you need to do is set up the HttpWebRequest properties the same when you create the object.
Btw, even though you aren't using a web service proxy so this doesn't apply in your case... in general, modifying the auto-generated proxy code is usually a bad idea (because every time you regenerate the code, you'll need to add back in the changes).