title: Why doesn't my ChannelFactory see my endpoint configuration?
body: <p>I've been following Miguel Castro's excellent article on WCF <a href="http://www.devx.com/codemag/Article/39837" rel="noreferrer">here</a> and it's all working nicely, except that I have the following code</p>
  
  <pre><code>public AdminClient()
  {
      ChannelFactory&lt;IProductAdmin&gt; factory = new ChannelFactory&lt;IProductAdmin&gt;();
      productAdminChannel = factory.CreateChannel();
  }
  </code></pre>
  
  <p>In my app.config file, I have the following configuration:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
      &lt;client&gt;
          &lt;endpoint address="net.tcp://localhost:8002/ProductBrowser"
                    binding="netTcpBinding"
                    contract="Contracts.IProductAdmin" /&gt;
      &lt;/client&gt;
  &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>But, when I run the constructor for AdminClient I get an exception saying that the endpoint isn't defined. However, if I change my configuration to give the endpoint a name, and then create the factory as follows, it works. </p>
  
  <pre><code>public AdminClient()
  {
      var fac = new ChannelFactory&lt;IProductAdmin&gt;("admin");
      productAdminChannel = fac.CreateChannel();
  }
  </code></pre>
  
  <hr>
  
  <pre><code>&lt;system.serviceModel&gt;
      &lt;client&gt;
          &lt;endpoint name="admin" 
                    address="net.tcp://localhost:8002/ProductBrowser"
                    binding="netTcpBinding"
                    contract="Contracts.IProductAdmin" /&gt;
      &lt;/client&gt;
  &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>I'd love an explanation for this. The documentation in MSDN isn't much help...</p>