title: How to use 'AddServiceEndpoint' address parameter in C#
body: <p>I have a question regarding the usage of 'AddServiceEndpoint' method of the 'ServiceHost' class.
  It seems that adding a value to the 'address' parameter part of this method does not work.</p>
  
  <p>Please refer to the code excerpt below:</p>
  
  <pre><code>Uri httpUrl = new Uri("http://localhost:8090/DuplexServer/SimpleCalculator");
  host.AddServiceEndpoint(typeof(DuplexServer.ICalculatorDuplex), new WSDualHttpBinding(), "");
  </code></pre>
  
  <p>Here, in order to test, I can access this URL through a Web Browser:
  <code>http://localhost:8090/DuplexServer/SimpleCalculator</code> and a webpage successfully shows.</p>
  
  <p>However, if I implemented it this way instead:</p>
  
  <pre><code>Uri httpUrl = new Uri("http://localhost:8090/DuplexServer/");
  host.AddServiceEndpoint(typeof(DuplexServer.ICalculatorDuplex), new WSDualHttpBinding(), "SimpleCalculator");
  </code></pre>
  
  <p>When I access : <code>http://localhost:8090/DuplexServer/SimpleCalculator</code>, a blank page appears.</p>
  
  <p>The method is being run in the host project's file, which is a console app.
  Whole code as requested:</p>
  
  <pre><code>class Program
      {
          static void Main(string[] args)
          {
              //Create a URI to serve as the base address
              Uri httpUrl = new Uri("http://localhost:8090/DuplexServer/SimpleCalculator");
  
              //Create ServiceHost
              ServiceHost host = new ServiceHost(typeof(DuplexServer.CalculatorService), httpUrl);
  
              //Add a service endpoint
              host.AddServiceEndpoint(typeof(DuplexServer.ICalculatorDuplex), new WSDualHttpBinding(), "");
  
              //Enable metadata exchange
              /*
              ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
              smb.HttpGetEnabled = true;
              host.Description.Behaviors.Add(smb);
              */
  
              //Start the Service
              host.Open();
  
              Console.WriteLine("Service is host at " + DateTime.Now.ToString());
              Console.WriteLine("Host is running... Press &lt;Enter&gt; key to stop");
              Console.ReadLine();
          }
      }
  </code></pre>
  
  <p>I would like to know the proper way to use the 'Address' parameter of this method.</p>
  
  <p>Thanks.</p>