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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:03:06+00:00 2026-06-01T21:03:06+00:00

I’ve taken the most basic example of setting up a hosted endpoint … http://msdn.microsoft.com/en-us/library/ms731758.aspx

  • 0

I’ve taken the most basic example of setting up a hosted endpoint …
http://msdn.microsoft.com/en-us/library/ms731758.aspx … and from this i want to have my service be configured in the way that it does within say IIS … using the config file for my application.

That seemingly is not the default in this scenario.

Any ideas?

EDIT:

as per the link above i have something like this …

// Create the ServiceHost.
using (ServiceHost host = new ServiceHost(typeof(HelloWorldService), baseAddress))
{
    // Enable metadata publishing.
    ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
    smb.HttpGetEnabled = true;
    smb.MetadataExporter.PolicyVersion = PolicyVersion.Policy15;
    host.Description.Behaviors.Add(smb);

    // Open the ServiceHost to start listening for messages. Since
    // no endpoints are explicitly configured, the runtime will create
    // one endpoint per base address for each service contract implemented
    // by the service.
    host.Open();

    Console.WriteLine("The service is ready at {0}", baseAddress);
    Console.WriteLine("Press <Enter> to stop the service.");
    Console.ReadLine();

    // Close the ServiceHost.
    host.Close();
}

now i want to have the “baseAddress” and the smb object info assigned using config.
for example as defined at http://msdn.microsoft.com/en-us/library/ms733932.aspx …

<system.ServiceModel>

   <services>
   <!—- Define the service endpoints. This section is optional in the new
    default configuration model in .NET Framework 4. -->
      <service>
         <endpoint/>
      </service>
   </services>

   <bindings>
   <!-- Specify one or more of the system-provided binding elements,
    for example, <basicHttpBinding> --> 
   <!-- Alternatively, <customBinding> elements. -->
      <binding>
      <!-- For example, a <BasicHttpBinding> element. -->
      </binding>
   </bindings>

   <behaviors>
   <!-- One or more of the system-provided or custom behavior elements. -->
      <behavior>
      <!-- For example, a <throttling> element. -->
      </behavior>
   </behaviors>

</system.ServiceModel>

my problem is that if i browse to the configured base address using my browser the endpoint isn’t there as expected.

I get no errors and its acting like theres an active endpoint up … but where is it?

EDIT 2: Additional info:
The code i’m using is as above, my config file looks like this …

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
    <section name="TaskServiceConfiguration" type="emedia.nemo.Configuration.XmlSerializerSectionHandler, emedia.nemo"/>
  </configSections>

  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>

  <TaskServiceConfiguration type="Emedia.TaskScheduler.Service.TaskServiceConfiguration, Emedia.TaskScheduler.Service, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
    <PollInterval>5</PollInterval>
    <ServiceURL>http://localhost:10000/TaskSchedulerService.svc</ServiceURL>
  </TaskServiceConfiguration>

  <log4net>
    <appender name="FileAppender" type="log4net.Appender.FileAppender">
      <file value="log-file.txt"/>
      <appendToFile value="true"/>
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date %-5level %logger - %message%newline"/>
      </layout>
    </appender>
    <appender name="DebugFileAppender" type="log4net.Appender.FileAppender">
      <file value="log-file.txt"/>
      <appendToFile value="true"/>
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date %-5level %logger - %message%newline"/>
      </layout>
    </appender>
    <appender name="ColoredConsoleAppender" type="log4net.Appender.ColoredConsoleAppender">
      <mapping>
        <level value="ERROR"/>
        <foreColor value="Red"/>
      </mapping>
      <mapping>
        <level value="DEBUG"/>
        <foreColor value="Yellow"/>
      </mapping>
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%-5level- %message%newline"/>
      </layout>
    </appender>
    <root>
      <level value="DEBUG"/>
      <appender-ref ref="FileAppender"/>
      <appender-ref ref="ColoredConsoleAppender"/>
    </root>
  </log4net>

  <system.diagnostics>
    <sources>
      <source name="System.ServiceModel.MessageLogging" switchValue="Warning, ActivityTracing">
        <listeners>
          <add name="Default" type="System.Diagnostics.DefaultTraceListener" />
          <add name="ServiceModelMessageLoggingListener" />
        </listeners>
      </source>
      <source name="System.ServiceModel" propagateActivity="true" switchValue="Warning, ActivityTracing">
        <listeners>
          <add name="Default" type="System.Diagnostics.DefaultTraceListener" />
          <add name="ServiceModelTraceListener" />
        </listeners>
      </source>
    </sources>
    <sharedListeners>
      <add name="ServiceModelMessageLoggingListener"
           initializeData="Web_messages.svclog"
           traceOutputOptions="Timestamp"
           type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
           />
      <add name="ServiceModelTraceListener"
           initializeData="Web_tracelog.svclog"
           traceOutputOptions="Timestamp"
           type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
           />
    </sharedListeners>
  </system.diagnostics>

  <system.serviceModel>
    <!-- Server side stuff -->
    <services>
      <service behaviorConfiguration="wsHttpBehaviour"
               name="Emedia.Messaging.Services.TaskSchedulerService">
        <endpoint address="http://localhost:10000/TaskSchedulerService.svc"
                  binding="wsHttpBinding"
                  bindingConfiguration="wsHttpBinding"
                  contract="Emedia.Messaging.Services.ITaskServiceContract"
                  />
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="wsHttpBehaviour">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
        <behavior name="">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>

    <!-- Client side stuff -->
    <bindings>
      <wsHttpBinding>
        <binding name="wsHttpBinding"
                 closeTimeout="00:01:00"
                 openTimeout="00:01:00"
                 receiveTimeout="00:10:00"
                 sendTimeout="00:01:00"
                 bypassProxyOnLocal="false"
                 transactionFlow="false"
                 hostNameComparisonMode="StrongWildcard"
                 maxBufferPoolSize="524288"
                 maxReceivedMessageSize="65536"
                 messageEncoding="Text"
                 textEncoding="utf-8"
                 useDefaultWebProxy="true"
                 allowCookies="false">
          <readerQuotas maxDepth="32"
                        maxStringContentLength="8192"
                        maxArrayLength="16384"
                        maxBytesPerRead="4096"
                        maxNameTableCharCount="16384"
                        />
          <reliableSession ordered="true"
                           inactivityTimeout="00:10:00"
                           enabled="false"
                           />
          <security mode="Message">
            <transport clientCredentialType="Windows"
                       proxyCredentialType="None"
                       realm=""
                       />
            <message clientCredentialType="Windows"
                     negotiateServiceCredential="true"
                     algorithmSuite="Default"
                     />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>

    <client>
      <endpoint address="http://localhost:10000/TaskSchedulerService.svc"
                binding="wsHttpBinding"
                bindingConfiguration="wsHttpBinding"
                contract="WCFTask.ITaskServiceContract"
                name="wsHttpBinding">
      </endpoint>
    </client>
  </system.serviceModel>
</configuration>

EDIT: some more detail on scope:

the wcf endpoint is defined in a web project.
the web project is referrenced by a windows service which hosts an instance of it.
i then have a console app that refers to and creates an instance of the windows service in order to test it.

My question is about getting that console app to fire up the windows service and that in turn the WCF endpoint so that it can then make calls on the endpoint in order to perform some end to end testing of my solution.

  • 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-01T21:03:07+00:00Added an answer on June 1, 2026 at 9:03 pm

    Revised Answer Based On Additional Info

    Ok, if I understand you correctly, you’ve created a WCF web application, and a separate Windows Service that creates an instance of that WCF service. Now you’re trying to create a console app to test your solution.

    I think you’re making things more complex than they need to be. The Windows Service should either be a client that calls the WCF service, or it should host the WCF service itself.

    In either event, if you’re writing a console app to do end-to-end testing of your solution, it certainly seems to me that the console app is the client – which as I’ve said has nothing to do with ServiceHost or hosting the service.

    Simply start the service from within your console app (or start it separately and have it already running), and then execute calls against the Windows Service in the same way any other client would.

    If I’m still missing something, let me know and I’ll try again. I’m about to sign off, so feel free to e-mail me (my address is in my profile) and I’ll look at it tomorrow.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
i got an object with contents of html markup in it, for example: string
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text

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.