title: How to use dll's .config file when referencing a service?
body: <p>I'm aware of the fact that if the code in a <code>.dll</code> wants to read its configuration file it should have to do it manually. But what if (in the same <code>.dll</code>) you're referencing a service, that would scaffold some code and will add some configuration to the <code>.config</code> file, so the only way I was able to use the service was copying that configuration to the main app's <code>.config</code> file.</p>
  
  <p>I'd like to know if somenone have another way to that. I think it should be using any of the constructors supplied by the scaffold but couldn't made it to work.</p>
  
  <p>These are the constructors:</p>
  
  <pre><code>MyServiceClient(string endpointConfigurationName)
  MyServiceClient(string endpointConfigurationName, string remoteAddress)
  MyServiceClient(string endpointConfigurationName, EndpointAddress remoteAddress)
  MyServiceClient(Binding binding, EndpointAddress remoteAddress)
  </code></pre>
  
  <p>And the configuration:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
      &lt;bindings&gt;
        &lt;basicHttpBinding&gt;
          &lt;binding name="BasicEndPoint" /&gt;
        &lt;/basicHttpBinding&gt;
      &lt;/bindings&gt;
      &lt;client&gt;
        &lt;endpoint address="&lt;service-url&gt;"
            binding="basicHttpBinding" bindingConfiguration="BasicEndPoint"
            contract="&lt;contract&gt;" name="BasicEndPoint" /&gt;
      &lt;/client&gt;
  &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>Thanks in advance!</p>