title: Self-hosting a WCF service, when I try to get one error can any solve the issue
body: <p>***could you provide the app.config file according to my Program class please </p>
  
  <p>if possible please provide app.config code i got your point but for that what you are telling i don't know how to do*** </p>
  
  <p>This code is not working because it's causing an error when reaching <code>host.open()</code>. Please help me solve the issue</p>
  
  <pre><code>public class Program
  {
      static void Main(string[] args)
      {
          // Base address
          Uri baseServiceAddress = new Uri("http://localhost:8090/Welcome");
  
          using (var host = new ServiceHost(typeof(WCFSelfHostedService), baseServiceAddress))
          {
              // Enable MetaData publishing.
              ServiceMetadataBehavior serviceMetaDataBehaviour = new ServiceMetadataBehavior();
              serviceMetaDataBehaviour.HttpGetEnabled = true;
              serviceMetaDataBehaviour.MetadataExporter.PolicyVersion = PolicyVersion.Policy15;
              host.Description.Behaviors.Add(serviceMetaDataBehaviour);
  
              // Open the ServiceHost to start listening for messages. No endpoint are explicitly defined, runtime creates default endpoint.
              host.Open();
  
              Console.WriteLine("The service is ready at {0} and host at {1}", baseServiceAddress, DateTime.Now.ToString());
              Console.WriteLine("The service and client is running in the same process.");
  
              WCFSelfHostedService selfHostService = new WCFSelfHostedService();
  
              Console.Write("Enter your name. : ");
              Console.WriteLine(selfHostService.WelComeMessage(Console.ReadLine()));
              Console.WriteLine("Host is running... Press &lt;Enter&gt; key to stop the service.");
              Console.ReadLine();
  
              //Close the service.
              host.Close();
          }
      }
  }
  </code></pre>
  
  <p>When I run this code I get this error:</p>
  
  <blockquote>
    <p><em>An unhandled exception of type 'System.InvalidOperationException'
    occurred in System.ServiceModel.dll</em></p>
    
    <p><em>Additional information: Service
    'WCFSelfHostedService.WCFSelfHostedService' has zero application
    (non-infrastructure) endpoints. This might be because no configuration
    file was found for your application, or because no service element
    matching the service name could be found in the configuration file, or
    because no endpoints were defined in the service element.</em></p>
  </blockquote>
  
  <p>My <code>app.config</code> is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; 
  &lt;configuration&gt; 
     &lt;system.serviceModel&gt; 
        &lt;client&gt; 
           &lt;endpoint 
               address ="localhost:8090/Welcome"; 
               binding ="wsHttpBinding" 
               contract ="MyCalculatorService.ISimpleCalculator"&gt; 
           &lt;/endpoint&gt; 
        &lt;/client&gt; 
     &lt;/system.serviceModel&gt; 
  &lt;/configuration&gt;
  </code></pre>