title: System.ServiceModel.AddressAccessDeniedException: HTTP could not register URL http::8080
body: <p>I have created my first self-hosted WCF service. I hosted it in a C# console app but it throws an error: </p>
  
  <blockquote>
    <p>System.ServiceModel.AddressAccessDeniedException: HTTP could not register URL http: 8080</p>
  </blockquote>
  
  <p>When I run Visual Studio 2013 as administrator, then it works well, but not if I don't. So any way to get it done automatically instead of starting VS as an ADMIN?</p>
  
  <p>So far I created a <code>HelloService</code> class library in which I added a WCF service which consists of an interface <code>IHelloService</code> and <code>HelloService</code>.</p>
  
  <p><code>IHelloService</code>:</p>
  
  <pre><code>namespace HelloService
  {
      [ServiceContract]
      public interface IHelloService
      {
          [OperationContract]
          String GetMsg();
      }
  }
  </code></pre>
  
  <p><code>HelloService</code>:</p>
  
  <pre><code>namespace HelloService
  {
      public class HelloService : IHelloService
      {
          public String GetMsg()
          {
              return "Service Accessed";
          }
      }
  }
  </code></pre>
  
  <p>Then I created a C# console app <code>HelloServiceHost</code> which has an <code>app.config</code> file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
    &lt;system.serviceModel&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors &gt;
          &lt;behavior name="MexBehaviour"&gt;
            &lt;serviceMetadata httpGetEnabled="true"/&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;services&gt;
        &lt;service name="HelloService.HelloService" 
                 behaviorConfiguration="MexBehaviour" &gt;
          &lt;endpoint 
              address="HelloService" 
              binding="basicHttpBinding" 
              contract="HelloService.IHelloService"&gt;&lt;/endpoint&gt;
          &lt;endpoint 
              address="HelloService" 
              binding="netTcpBinding" 
              contract="HelloService.IHelloService"&gt;&lt;/endpoint&gt;
          &lt;endpoint 
              address="mex" 
              binding="mexHttpBinding" 
              contract="IMetadataExchange"&gt;&lt;/endpoint&gt;
          &lt;host&gt;
            &lt;baseAddresses&gt;
              &lt;add baseAddress="http://localhost:8080/"/&gt;
              &lt;add baseAddress="net.tcp://localhost:8081/"/&gt;
            &lt;/baseAddresses&gt;
          &lt;/host&gt;
        &lt;/service&gt;
      &lt;/services&gt;
    &lt;/system.serviceModel&gt;
  &lt;/configuration&gt; 
  </code></pre>
  
  <p>and program.cs file:</p>
  
  <pre><code>using HelloService;
  using System.ServiceModel;
  
  namespace HelloServiceHost
  {
      class Program
      {
          static void Main(string[] args)
          {
              using(ServiceHost sh = new ServiceHost(typeof(HelloService.HelloService)))
              {
                  sh.Open();
                  Console.WriteLine("Host Started @"+ System.DateTime.UtcNow.ToShortDateString());
                  sh.Close();
              }
          }
      }
  }
  </code></pre>
  
  <p>I followed a video tutorial exactly but it's not working why ?</p>
  
  <p>I am using VS 2013, .net 4</p>