I have been struggling with this issue for literally weeks now, but seem to have found a resolution after trying every option on the net. However i'm still at a loss to explain it.
We have a web service with a method that performs a long running SQL query and takes roughly 7 minutes to complete. However, on intermittant runs we get the error;
"The underlying connection was closed: An unexpected error occurred on a receive."
Now it turns out that in IIS7 it was the Process Model section on the application pool causing this. Even if we set the 'Ping Maximum Response Time' to something like 600 seconds (10 minutes) the error would still appear at random times... sometimes even after only 100 seconds or so.
The only way to stop this error from happening is to set the 'Ping Enabled' feature to false.
I am concerned that this might not be the best way to fix the issue... but the client needs it fixed so this will do for now. Can anyone shed any light on this? We have other sites using older versions of IIS and SQL that do not have this issue. It is only happening on a server running SQL 2008 R2 Express and IIS 7.5.
It is built on the .NET framework v2.0.
Thanks for any insight anyone could give.