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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:02:48+00:00 2026-06-18T14:02:48+00:00

Im trying to host to different service implementations of the same contract: The reason

  • 0

Im trying to host to different service implementations of the same contract:

Model

The reason is that need a dummy implementation for out-of-the-house testing.

Im trying to host both in the same WindowsService:

    private ServiceHost _host;
    private ServiceHost _dummy;
    protected override void OnStart(string[] args)
    {
        _host = new ServiceHost(typeof(Service));
        _host.Open();

 //trying to avoid the app.config beeing used - because its already been hoste by _host
        _dummy = new ServiceHost(typeof(TestDummyService));
        _dummy.Description.Endpoints.Clear();
        _dummy.AddServiceEndpoint(typeof(IService), 
                                   new WebHttpBinding(),
                                  @"<link>/Dummy.svc/");
        _dummy.ChannelDispatchers.Clear();
        _dummy.Open();
     }

This is the config file:

  <system.serviceModel>
    <services>
      <service name="namespace.Service">
        <host>
          <baseAddresses>
            <add baseAddress="<link>/Service.svc"/>
          </baseAddresses>
        </host>
        <endpoint address="" 
                  binding="webHttpBinding" 
                  contract="namespace.IService" 
                  behaviorConfiguration="web" />

        <endpoint address="/mex" 
                  binding="mexHttpBinding" 
                  contract="IMetadataExchange" />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors >
        <behavior>
          <serviceMetadata httpGetEnabled="true"
                           httpGetUrl="<link>/Service.svc/About" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name ="web">
          <webHttp />         
        </behavior>
      </endpointBehaviors>
    </behaviors>
  </system.serviceModel>

The ChannelDispatcher at /Service.svc/About with Contracts ‘IHttpGetHelpPageAndMetadataContract’ is unable to open.

any help is appreciated.

Update 1
My goal is to have 2 different implementations of the same contract (IService) hosted in one WindowsService.

I would also like to configure both of them in the config file.

  • 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-06-18T14:02:49+00:00Added an answer on June 18, 2026 at 2:02 pm

    so i found out, that even thow the testdummy service was added programatic, it still got the service metadatabehavior.

    My solution was to not make the dehavior default – given it at name:

    app.config:

    <service name="namespace.Service" behaviorConfiguration="someName">
    

    //.. later:

        <behavior name="someName">
          <serviceMetadata httpGetEnabled="true"
                           httpGetUrl="<link>/Service.svc/About" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
    

    The rest of the code, statyed the same

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

Sidebar

Related Questions

There is a whole host of components that I am trying out to better
I am trying to host multiple different rails apps on the same VPS using
I'm trying to host my WCF service in a windows service host. For managing
I am trying to host an ASP.NET application that is running the Silverlight Video
I have a WCF service. I am trying to host the service in a
I am trying to get Android USB host mode to work; but I need
I'm trying to use eJabberd to host a chatting service. The problem I am
I am trying to host a long running workflow service on Azure but I
I'm trying to host a very simple database on Azure and going out of
I am trying to host a WCF service on a windows 2008 R2 server

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.