Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6577483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:38:30+00:00 2026-05-25T15:38:30+00:00

I apologise if this seems a little basic, but I’m new to WCF –

  • 0

I apologise if this seems a little basic, but I’m new to WCF – and also to interprocess communication in general.

Details of my Setup

I’m using a NetNamedPipeBinding in my WCF “server”, which is part of an application that runs as a windows service.

I have two clients that communicate with the WCF server, using a channel created by a DuplexChannelFactory. One is an ASP.Net MVC 3 web application, which creates a channel (and then closes it**) with each page request. The other is a WPF application (used as a sort of monitoring console / diagnostic tool for the service).

Everything runs along fine – often for a week or more – with lots of people accessing the web application, but just occasionally something breaks inside the WCF “server” and the clients begin reporting an exception “The communication object, System.ServiceModel.Channels.ServiceChannel,
cannot be used for communication because it is in a Faulted state” whenever they try to create a channel proxy.

Once the server “faults”, every attempt to connect results in that error. Even new instances of the console application will report it. This leads me to believe it’s not an issue at the “client” end.

** NOTE: I think the channel is closed with each page request. It is instantiated as a member of the MVC controller, which to my knowledge falls out of scope and is disposed at the end of the request. Perhaps I’m wrong?

The Question(s):

Does anyone have any suggestions on where to look – and even how I might be able to reproduce this issue in my test environment.

Can this sort of thing be eliminated entirely? Or should I resort to having a thread inside the “server” which attempts to connect to the named pipe service every few minutes and restart the service if it fails?

Addtional Information

It may be helpful to include the code that I’m using (in the WCF “Server”) to listen to requests on the Named Pipe

host = new ServiceHost(
    this,
    new Uri[] {
        new Uri("net.pipe://localhost")
    }
);
host.AddServiceEndpoint(
    typeof(IStationDirectory),
    new NetNamedPipeBinding(),
    "StationDirectory"
);

host.Open();

/* Some logging code here */


Thread.Sleep(Timeout.Infinite);

More Questions

Assuming I understand correctly each NamedPipe “Channel” is effectively the same thing as a TCP connection (unique to each client/server pair). If I keep seeing the channel faulted error with new clients, then presumably every new channel that is being created by clients is somehow broken from the start. Does this mean that the failure is somewhere inside the ServiceHost? Would there be any benefit in catching host.Faulted events here?

Update on Resolution (2013)

I know it’s been a very long time since I asked this question – but I just noticed it in my history here on SO and I thought I should add that Nick had hit the nail on the head. I believe it was the message payload size that was causing the problem. Included in the messages were a list of “report” objects, that each linked to the previous report. Over time this list would grow. Pruning off the old reports and keeping the WCF messages at a more-or-less fixed size stopped the faults. The application has been running very reliably for the last couple of years.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:38:31+00:00Added an answer on May 25, 2026 at 3:38 pm

    I’d start by doing some WCF tracing.

    http://msdn.microsoft.com/en-us/library/ms733025.aspx

    If they’re faulting with absolutely no events logged anywhere you can see (in Event Viewer) then it’s probably either

    1. Message payload is too big for your binding. If you’re returning large result sets, and it’s intermittent, I’d start here. Check your maxItemsInObjectGraph binding configuration as well.
    2. Unhandled exceptions on the service start. That doesn’t seem to be your problem.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am pretty new to PHP so I apologise if this seems like a
I realise that this must be a very basic question, but my google-fu seems
I'm new to PHP so I apologize if this seems silly. I've searched around
I apologise upfront this is really simply but causing me much annoyance. I have
I apologise if this has been asked before but I can't find the info
this may seem a little odd, but it would make for a convenient way
I apologise for the blatant ignorance of this question but I've been charged with
This seems like a simple question to ask but, is it generally a good
I apologise in advance for the poor quality of this question but here goes:
Apologies if this seems like I want my problem saved for me, but I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.