WCF NamedPipe CommunicationException - “The pipe has been ended. (109, 0x6d).”

前端 未结 9 1309
没有蜡笔的小新
没有蜡笔的小新 2020-12-16 13:18

I am writing a Windows Service with accompanying \"status tool.\" The service hosts a WCF named pipe endpoint for inter-process communication. Through the named pipe, the

相关标签:
9条回答
  • 2020-12-16 13:58

    This happened in my WCF service when the payload returned was too big. Fixed it by adding this in a serviceBehavior in app.config:

    <dataContractSerializer maxItemsInObjectGraph="[some big number]" />
    
    0 讨论(0)
  • 2020-12-16 13:59

    I got this error when the service operation threw and the channel was actually faulted. In your case, you have already verified that the service operation as such completed correctly and only the return threw, but if there is doubt, make sure the service operation runs OK.

    0 讨论(0)
  • 2020-12-16 14:01

    I had this issue because I was using an older tutorial, and trying to configure programatically.

    The part I was missing was to supply the metadata endpoint (thank you, this post!).

    ServiceMetadataBehavior serviceMetadataBehavior = 
        host.Description.Behaviors.Find<ServiceMetadataBehavior>();
    
    if (serviceMetadataBehavior == null)
    {
        serviceMetadataBehavior = new ServiceMetadataBehavior();
        host.Description.Behaviors.Add(serviceMetadataBehavior);
    }
    
    host.AddServiceEndpoint(
        typeof(IMetadataExchange), 
        MetadataExchangeBindings.CreateMexNamedPipeBinding(), 
        "net.pipe://localhost/PipeReverse/mex"
    );
    
    0 讨论(0)
提交回复
热议问题