The underlying connection was closed: The connection was closed unexpectedly


The underlying connection was closed: The connection was closed unexpectedly. This happens on my WCF service that is hosted on the visual studio 2010 built in development server.


this does not happen all the time I believe it is a "big Data" issue, I have googled as hard as I can but non of the solutions I have implemented have fixed anything (and I have tried most of them out there) I most likely am just missing something stupid.


Why is this happening and how can I fix it?

Client app.Config:

<?xml version="1.0" encoding="utf-8" ?>
        <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
            <section name="Program.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
              <binding name="BasicHttpBinding_IService1" maxReceivedMessageSize="20000000"
                <readerQuotas maxDepth="32"
            <endpoint address="http://localhost:62753/Service1.svc" binding="basicHttpBinding"
                bindingConfiguration="BasicHttpBinding_IService1" contract="ProgramService.IService1"
                name="BasicHttpBinding_IService1" />
          <behavior name="EndpointBehavior">
            <dataContractSerializer maxItemsInObjectGraph="2147483647" />
            <setting name="Program_PROGRAM_Screen" serializeAs="String">

Service web.config:

<?xml version="1.0" encoding="utf-8"?>
    <compilation debug="true" targetFramework="4.0">
        <add assembly="System.Data.Entity, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <httpRuntime executionTimeout="1200" />
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true" />
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="true" />
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
    <modules runAllManagedModulesForAllRequests="true" />
    <add name="ProgramEntities" connectionString="metadata=res://*/Program.csdl|res://*/Program.ssdl|res://*/Program.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=ACUMATICA1-HPI7;initial catalog=Program;persist security info=True;user id=sa;password=$0l0m0n;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />

WCF Activity Log Erro Message:

There was an error while trying to serialize parameter The InnerException message was 'Type 'System.Data.Entity.DynamicProxies.ScenarioSummary_A170028D0330F7804BAB85D00BA1EB45FA1754C8A6F6E98C0F003F15078E23A9' with data contract name 'ScenarioSummary_A170028D0330F7804BAB85D00BA1EB45FA1754C8A6F6E98C0F003F15078E23A9:' is not expected. Consider using a DataContractResolver or add any types not known statically to the list of known types - for example, by using the KnownTypeAttribute attribute or by adding them to the list of known types passed to DataContractSerializer.'. Please see InnerException for more details.

Service Information:

I am trying to return a list of Entity Framework stuff

List<ProgramService.ScenarioSummary> ScenarioSummary(string Module);

public List<ProgramService.ScenarioSummary> ScenarioSummary(string module)
            return (from p in Entity.ScenarioSummaries where p.ModuleId.Equals(Entity.Modules.FirstOrDefault(q => q.ModuleName.Equals(module)).Id) select p).ToList();

additional Information:

Any help/explanation of my clear incompetence in this matter and how to correct it would be much appreciated.


Some one commented that my error looked alot like What are the downsides to turning off ProxyCreationEnabled for CTP5 of EF code first

and that actually turned out to be my solution. They have since deleted there posting. Thank you mysterious stranger with greater googling skills than I.

Need Your Help

IIS7 HTTP to HTTPS Redirection

http url redirect iis-7 https

I having some difficulty redirecting users to HTTPS using IIS7. I've tried following the steps outlined on a variety of sites which include editing web.config, URL Rewrite Module, and custom error

How to change the dimension of the field in the type by DQL?

dql alter documentum documentum6.5

How to change the dimension of the field in the type by DQL?

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.