title: Dynamics CRM CrmServiceClient - how to connect to multiple organisations?
body: <p>I have an ASP.Net web application which connects to Dynamics CRM using the XRM Tooling Connector. I pass in a connection string and create the connection like this:</p>
  
  <pre><code> CrmServiceClient conn = new CrmServiceClient(ConnectionString);
  </code></pre>
  
  <p>This works fine if I am connecting to one Dynamics CRM organisation. However if I want to change my connection in the ASP.Net application, and call the service clients with a different connection string</p>
  
  <pre><code>CrmServiceClient conn = new CrmServiceClient(ConnectionString**2**);
  </code></pre>
  
  <p>The new connection string is ignored and the connection remains to the original connection string. This is due to the connection pooling, I assume.</p>
  
  <p>If I call <code>conn.Dispose()</code> before setting the connection string - this makes no difference. </p>
  
  <p>What does work is setting "<code>requireNewInstance=True</code>"  in both connection strings. When I do this the web application is able to switch between organisations.. but the performance of the web app is terrible. Each page which would take &lt;1s to load before would then take 30s or more to load as the connection is created from new each time.</p>
  
  <p>Is there anyway to have two instances of CrmServiceClient alive at once, connected to two different CRM orgs? Or is there any way to force CrmServiceClent to be disposed and created new?</p>