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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:27:02+00:00 2026-05-25T03:27:02+00:00

I am trying to host several WCF REST services on the same port. I

  • 0

I am trying to host several WCF REST services on the same port. I started Net.Tcp Port Sharing Service and this is my app.config file:

<?xml version="1.0"?>
<configuration>

  <system.serviceModel>    
    <services>  
      <service name="MyService">
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost/services/"/>
          </baseAddresses>
        </host>

        <endpoint
          address="test"
          binding="webHttpBinding"
          contract="IMyService"/>
      </service>
    </services>

    <behaviors>
      <endpointBehaviors>
        <behavior>
          <webHttp/>
        </behavior>
      </endpointBehaviors>
    </behaviors>

    <bindings>
      <netTcpBinding>
        <binding name="PortSharingEnabled" portSharingEnabled="true">
        </binding>
      </netTcpBinding>
    </bindings>

  </system.serviceModel>

</configuration>

I still cannot host two services on the same port.

When I try to run the second service, I get the following error: http://screencast.com/t/Vlakb26XbuQr.
“The Service service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs”.

Trace log (http://screencast.com/t/tJ5Gvmy4Dgm7) says:
“HTTP could not register URL http://+:7778/MyServiceName/. Another application has already registered this URL with HTTP.SYS.”

EDIT:

<services>
  <service name="Service1">
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:7778/"/>
      </baseAddresses>
    </host>
    <endpoint
      address="first"
      binding="webHttpBinding"
      contract="IService1"/>
  </service>
  <service name="Service2">
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:7778/"/>
      </baseAddresses>
    </host>
    <endpoint
      address="second"
      binding="webHttpBinding"
      contract="IService2"/>
  </service>
</services>

I suppose something is missing to enable port sharing?

  • 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-25T03:27:03+00:00Added an answer on May 25, 2026 at 3:27 am

    What you are attempting to do makes no sense. “Port-Sharing” can happen in two ways:

    • Http: This works (sort of) out of the box on Windows, since HTTP is handled by the HTTP.SYS Kernel-Level driver. There is nothing particular you need to do.

    • Net.Tcp Port Sharing. This requires the steps outlined here.

    However your (only) endpoint is configured to use the HTTP-Binding, not the Net.Tcp-Binding (which in turn makes sense if you want to use a REST-style service), so Net.Tcp Port sharing is not applicable here.

    Without more information on what exactly you want to do, what error you are seeing, it is hard to help.

    EDIT

    Still confusing. From your app.config it looks as if you are using port 80 for your endpoints, however the error message you cite says port 8080. Whatever, the following is applicable anyway.

    From the error messages your provided, it looks as if you’re trying to register/start the service twice with the exact same endpoint URI. This will not work. You can reuse the hostname:port part, or even parts of the path, but the complete URI must be unique.

    For example, you could use the following endpoint URIs:

    • http://localhost:8080/myservice/ServiceInstance1
    • http://localhost:8080/myservice/ServiceInstance2

    Note that this is the same for Net.Tcp port sharing – you can share the port, but not the complete (unique) endpoint URI. Hence the name name “port” sharing. It is not a transparent load balancing mechanism or such.

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

Sidebar

Related Questions

I'm trying to host a WCF service inside a console app using Castle-Windsor 2.5
I have a WCF service. I am trying to host the service in a
I'm trying to connect to an existing Windows Service that exposes several WCF endpoints.
I am trying to host WCF serviec in managed Windows Service. Basically i have
While trying to host the CLR, I keep getting this: error C2440: 'function' :
I am trying to host an ASP.NET application that is running the Silverlight Video
I'm trying to load and host a WPF control in a .net 2.0 windows
I am creating a Host SL app that will serve up several Plugins Each
I'm trying to configure my local Apache2 server to host several Symfony websites using
I have a VPS and i'm trying to host several SVN projects. I'd like

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.