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 7171005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:19:31+00:00 2026-05-28T15:19:31+00:00

I have a WCF service hosted on my local machine as windows service. Now

  • 0

I have a WCF service hosted on my local machine as windows service. Now I’m trying to add a service reference in the client (again on my local dev machine) but I’m getting an error

Metadata contains a reference that cannot be resolved:
‘net.tcp://localhost:8523/Service1’. Could not connect to
net.tcp://localhost:8523/Service1. The connection attempt lasted for a
time span of 00:00:02.0011145. TCP error code 10061: No connection
could be made because the target machine actively refused it

I checked that the Windows firewall doesn’t block port 8523. I even created a new rule in Windows firewall to allow run 8523 port. But when I’m running netstat -sp tcp I can’t seem to find port 8523. But I can see Serice1 service’s state is set to START in Services. This is the config files

Service Library

<system.serviceModel>
  <services>
    <service name="WcfServiceLibrary1.Service1">
      <endpoint 
           address="" 
           binding="netTcpBinding" bindingConfiguration=""
           contract="WcfServiceLibrary1.IService1">
         <identity>
           <dns value="localhost" />
         </identity>
      </endpoint>
      <endpoint 
           address="mex" 
           binding="mexTcpBinding" bindingConfiguration=""
           contract="IMetadataExchange" />
      <host>
        <baseAddresses>
          <add baseAddress="net.tcp://localhost:8523/Service1" />
        </baseAddresses>
      </host>
    </service>
  </services>
  <behaviors>
    <serviceBehaviors>
      <behavior name="">
        <serviceMetadata httpGetEnabled="false" />
        <serviceDebug includeExceptionDetailInFaults="false" />
      </behavior>
    </serviceBehaviors>
  </behaviors>
</system.serviceModel>

Config in the windows service project looks identical.

  • 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-28T15:19:32+00:00Added an answer on May 28, 2026 at 3:19 pm

    Michael, this is a net.tcp binding that I typically use for a WCF service.

        <bindings>
            <netTcpBinding>
                <binding name="TcpBinding"
                         receiveTimeout="Infinite"
                         sendTimeout="Infinite"
                         maxBufferSize="2147483647"
                         maxReceivedMessageSize="2147483647">
                    <reliableSession inactivityTimeout="Infinite"/>
                    <security mode="None"/>
                </binding>
            </netTcpBinding>
        </bindings>
    

    Try to add it to your configuration:

    <service name="WcfServiceLibrary1.Service1">   
        <endpoint    
            address=""    
            binding="netTcpBinding" bindingConfiguration="TcpBinding"   
            contract="WcfServiceLibrary1.IService1">   
        ...
    

    Also, my services are running under ServiceAccount.LocalSystem.

    Check

    netstat –ap tcp

    if the service is listening.

    EDIT: my Service class below. Note that the current directory of the windows service is set programatically to the BaseDirectory, i.e. the directory of the executable.

    public class Service : ServiceBase
    {
        public static void Main()
        {
            Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory);
            ServiceBase.Run(new Service());
        }
    
        ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have hosted a WCF service in my local machine(XP SP3) lets name as
I have a WCF service hosted on a remote machine. On my local machine
I have a service reference on my local dev environment to a WCF service
I have a wcf application hosted in a windows service running a local windows
I have a WCF service running locally hosted by a windows service on machine
I have a WCF service hosted in my local IIS and I'm trying to
We have created a WCF service hosted in a windows service that handles Authentication
I have a wcf service library that is hosted in a windows service. I
I have a WCF service, hosted in IIS returning the following error (when trying
I have a WCF service hosted at local IIS. I created a ASP.NET website

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.