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

  • SEARCH
  • Home
  • 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 6968117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:24:36+00:00 2026-05-27T16:24:36+00:00

I have a problem with WCF NetNamedPipeBinding. When I run my server and client

  • 0

I have a problem with WCF NetNamedPipeBinding. When I run my server and client code through Visual Studio 2008 on a Windows XP machine everything works fine. But as soon as I deploy my server as a Windows Service and install my client app in Windows Server 2008 I get a TimeoutException on the client end whenever I try to use any of the contract methods. It seems that I can successfully create the client and open it, but can’t call any of the methods.

Service initialisation code:

Uri baseAddress = new Uri("http://localhost:8500/xNet/xNetService");
string address = "net.pipe://localhost/xNet/xNetService";

_xNetAPIServiceHost = new ServiceHost(typeof(xNetService), baseAddress);

NetNamedPipeBinding binding = new NetNamedPipeBinding(NetNamedPipeSecurityMode.None);
_xNetAPIServiceHost.AddServiceEndpoint(typeof(IServiceAPI), binding, address);

// Add a mex endpoint
ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
smb.HttpGetEnabled = true;
smb.HttpGetUrl = new Uri("http://localhost:8501/xNet/xNetService/mex");
_xNetAPIServiceHost.Description.Behaviors.Add(smb);

_xNetAPIServiceHost.Open();

Client initialisation code:

string address = "net.pipe://localhost/xNet/xNetService";

NetNamedPipeBinding binding = new NetNamedPipeBinding(NetNamedPipeSecurityMode.None);

_serviceClient = new ServiceAPIClient(binding, new EndpointAddress(address));
_serviceClient.Open();

The Windows service runs as “Local System Account”. I’m at a loss as to what the problem is. I don’t know if it’s a security account problem, or if the named pipe is even open? I would assume since I can successfully create and open the client side it would appear it at least found the named pipe. I just can’t call any of the service methods without a TimeoutException.

  • 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-27T16:24:37+00:00Added an answer on May 27, 2026 at 4:24 pm

    After trying out various bindings and going back to basics I noticed that the sample programs worked, but mine didn’t work unless I was using Visual Studio to debug. I decided at that point that it must be something going on with my own code. To simplify debugging I turned off all security in the binding.

    I started commenting out most of the statements in my service’s OnStart method in order to determine what could be going on. I commented out everything except for the code that initialises the ServiceHost. Magically, my client could now successfully communicate with the service. I then started uncommenting each line of code in the OnStart method until my client suddenly started giving me a TimeoutException again.

    My service class, say “MyAPI”, implements the contract “IMyAPI”. As well as using “MyAPI” class as the WCF service, I was also using an instance of the “MyAPI” class internally in my service to do various things (“internal” methods). In my OnStart method I first created an instance of the “MyAPI” class and then created the ServiceHost:

    MyAPI API = new MyAPI();
    
    ServiceHost service = new ServiceHost(typeof(MyAPI));
    

    I was not getting any errors or exceptions, so it appeared everything is fine, but really I couldn’t connect to the service using a client. As soon as I changed the order of the above statements, the client started working again:

    ServiceHost service = new ServiceHost(typeof(MyAPI));
    
    MyAPI API = new MyAPI();
    

    I’m not sure WHY this is occuring, all I know is that I can use my API internally and as a service without any client connection issues. Maybe someone out there will provide some light on the reasons behind this, or maybe my code is not properly designed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have hosted my WCF windows service on WINDOWS 7 OS and have client
I have a problem with WCF deserialization where the client hangs on the response
I have an interesting problem with WCF in a Windows 7 environment... it's slooooooow.
I have WCF Class library, WCF Service Client and WCF Service Server in one
I have a problem of WCF definition of MessageContact and client calling function. Scenario;
I have a problem. I have coded a wcf client (WPF and c#) that
I have a WCF-Service, written in Visual Basic using Visual Studio 2010. I would
I have a problem with my WCF Data Service, and this one is just
I have a problem with getting jquery to retrieve results from a WCF service.
Problem: I have a WCF service setup to be an endpoint for a call

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.