The underlying connection was closed: unexpected error on a receipt

I have a web site that communicated with a WCF. This Wcf communicates with my " DAO " which is a Class Library where I have the model.edmx for bank access. I referenced my DAO on WCF, and my WCF on my web site.

I'm using entity framework and webForms.

In the Inner Exception is generating the following error.

The underlying connection was closed: unexpected error on a receipt.

In my code generates the following error.

Error receiving HTTP response to http://locahost:4614/Service.svc. this may be related to the fact that the service endpoint Association does not use the HTTP protocol. It can also be related to the cancellation of a HTTP request context by the server (possibly due to service shutdown). See server logs for more details

Can anyone help me?

Author: Marconi, 2014-10-22

2 answers

Add in your connectionString in the file Web.config:

"MultipleActiveResultSets=true;" 

Example:

"Data Source=.\SQLEXPRESS;Initial Catalog=MeuSistema;Integrated Security=True;MultipleActiveResultSets=true;" 
 2
Author: Leonel Sanches da Silva, 2014-10-23 04:03:10

Another solution for the same error message:

Entity by default is configured to generate a proxy automatically, the solution then is to disable this option with the command below:

DbContext.Configuration.ProxyCreationEnabled = false;

Alberto Amorim
https://www.devmedia.com.br/forum/wcf-entityframework-5-code-first/426154

 -2
Author: Camilassos, 2017-11-10 18:32:42