title: WCF Named Pipe IO Exception - The pipe has been ended. (109, 0x6d)
body: <p>We have a WCF service which calls several other services through Net.Pipes protocol on start up. The call return a list of string, <strong>no Enum or complex objects</strong>.</p>
  
  <p>Sometimes, we receive the following exception.</p>
  
  <pre><code>    System.ServiceModel.CommunicationException: There was an error reading from the pipe: The pipe has been ended. (109, 0x6d). ---&gt; System.IO.IOException: The read operation failed, see inner exception. ---&gt; System.ServiceModel.CommunicationException: There was an error reading from the pipe: The pipe has been ended. (109, 0x6d). ---&gt; System.IO.PipeException: There was an error reading from the pipe: The pipe has been ended. (109, 0x6d).
     at System.ServiceModel.Channels.PipeConnection.FinishSyncRead(Boolean traceExceptionsAsErrors)
     at System.ServiceModel.Channels.PipeConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
     --- End of inner exception stack trace ---
     at System.ServiceModel.Channels.PipeConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
     at System.ServiceModel.Channels.ConnectionStream.Read(Byte[] buffer, Int32 offset, Int32 count)
     at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
     at System.Net.Security.NegotiateStream.StartFrameHeader(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
     at System.Net.Security.NegotiateStream.StartReading(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
     at System.Net.Security.NegotiateStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
     --- End of inner exception stack trace ---
     at System.Net.Security.NegotiateStream.ProcessRead(Byte[] buffer, Int32 offset, Int32 count, AsyncProtocolRequest asyncRequest)
     at System.Net.Security.NegotiateStream.Read(Byte[] buffer, Int32 offset, Int32 count)
     at System.ServiceModel.Channels.StreamConnection.Read(Byte[] buffer, Int32 offset, Int32 size, TimeSpan timeout)
     --- End of inner exception stack trace ---
  </code></pre>
  
  <p>It does not occur every time. I could not find almost any references to this error.</p>
  
  <p>I would like to know, why does it happens and how to prevent it.</p>