title: Replace configuration in app.config with code configuration for WCF service
body: <p>I'm trying to connect to <code>DevelpmentService</code> of MS CRM from custom plugin and thus I'm not able to use <code>app.config</code> generated when I added WebReference to solution.</p>
  
  <p>Here is the working code:</p>
  
  <pre><code>var id = new EntityInstanceId
  {
      Id = new Guid("682f3258-48ff-e211-857a-2c27d745b005")
  };
  
  var client = new DeploymentServiceClient("CustomBinding_IDeploymentService");
  
  var organization = (Organization)client.Retrieve(DeploymentEntityType.Organization, id);
  </code></pre>
  
  <p>And corresponding part of the <code>app.config</code>:</p>
  
  <pre><code>&lt;client&gt;
      &lt;endpoint address="http://server/XRMDeployment/2011/Deployment.svc"
          binding="customBinding" bindingConfiguration="CustomBinding_IDeploymentService"
          contract="DeploymentService.IDeploymentService" name="CustomBinding_IDeploymentService"&gt;
          &lt;identity&gt;
              &lt;userPrincipalName value="DOMAIN\DYNAMICS_CRM" /&gt;
          &lt;/identity&gt;
      &lt;/endpoint&gt;
  
      ...
  
  &lt;/client&gt;
  </code></pre>
  
  <p>Is it possible to transform code in the way when configuration file will not be needed. How?</p>