The underlying connection was closed: Unexpected error on receipt

3

I have a web site that communicates with a WCF. This Wcf communicates with my "DAO" which is a class library where I have the .edmx template for access to the database. I referred my DAO to WCF, and my WCF to my web site.

I'm using entity framework and webForms.

In Inner Exception is generating the following error.

  

The underlying connection was closed: Unexpected error in one   receipt.

In my code it generates the following error.

  

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

Can anyone help me?

    
asked by anonymous 23.10.2014 / 01:07

2 answers

2

Add to your connectionString in the file Web.config :

"MultipleActiveResultSets=true;" 

Example:

"Data Source=.\SQLEXPRESS;Initial Catalog=MeuSistema;Integrated Security=True;MultipleActiveResultSets=true;" 
    
23.10.2014 / 06:03
-2

Another solution to the same error message:

  

The entity by default is configured to generate a proxy   automatically, the solution is to deactivate this option with the command   below:

     

DbContext.Configuration.ProxyCreationEnabled = false;

     

Alberto Amorim
link

    
10.11.2017 / 19:00