Server Error in '/' Application.

An existing connection was forcibly closed by the remote host

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

Source Error:


Line 54: 		// Include the local header include document
Line 55: 		WebClient client = new WebClient ();
Line 56:     		string localHeaderInclude = client.DownloadString (Application["CS_SiteURL"].ToString() + "/default.aspx?id=" + headIncludeId .ToString()).Trim();
Line 57: 		if (!String.IsNullOrEmpty(localHeaderInclude)) {
Line 58: 			LiteralControl lc = new LiteralControl(

Source File: d:\ContentStudio.Net\Sites\Ålö\Admin\FullpagePresentationTemplates\DefaultFullPagePresentationTemplate.aspx.cs    Line: 56

Stack Trace:


[SocketException (0x2746): An existing connection was forcibly closed by the remote host]
   System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) +222

[IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.]
   System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) +782
   System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count) +48
   System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest) +220
   System.Net.Security.SslState.CheckCompletionBeforeNextReceive(ProtocolToken message, AsyncProtocolRequest asyncRequest) +345
   System.Net.Security.SslState.ForceAuthentication(Boolean receiveFirst, Byte[] buffer, AsyncProtocolRequest asyncRequest) +203
   System.Net.Security.SslState.ProcessAuthentication(LazyAsyncResult lazyResult) +769
   System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) +355
   System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) +20
   System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) +82
   System.Net.TlsStream.ProcessAuthentication(LazyAsyncResult result) +1105
   System.Net.TlsStream.Write(Byte[] buffer, Int32 offset, Int32 size) +60
   System.Net.PooledStream.Write(Byte[] buffer, Int32 offset, Int32 size) +122
   System.Net.ConnectStream.WriteHeaders(Boolean async) +463

[WebException: The underlying connection was closed: An unexpected error occurred on a send.]
   System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request) +365
   System.Net.WebClient.DownloadString(Uri address) +111
   CS_default_1037.Page_Init(Object sender, EventArgs e) in d:\ContentStudio.Net\Sites\Ålö\Admin\FullpagePresentationTemplates\DefaultFullPagePresentationTemplate.aspx.cs:56
   System.Web.UI.Control.OnInit(EventArgs e) +106
   System.Web.UI.Page.OnInit(EventArgs e) +16
   System.Web.UI.Control.InitRecursive(Control namingContainer) +166
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1598


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3535.0