title: Dynamic endpoints in ServiceReferences.ClientConfig
body: <p>When building an app, it is often deployed in different environments (test, dev, prod), and therefore the endpoint addresses are changing. As the ServiceReferences.ClientConfig is built as a part of Silverlight's .xap file, its hard to change  the endpoints after building the solution, as often is done with web.config.</p>
  
  <p>I've searched quite a bit for it, but I cant figure out what is best practice here, so my question is:</p>
  
  <p>What is best practice when it comes to dynamic wcf endpoint address configuration in silverlight?</p>
  
  <p>To clarify, depending on which server the app is on (test,dev, prod) the endpoints change:</p>
  
  <pre><code>  &lt;endpoint
      name="MyService"
      address="http://testserv/MyService.svc"
      binding="basicHttpBinding"
      bindingConfiguration="MybasicHttpBinding"
      contract="MyApp.MyService"
               /&gt;
  
    &lt;endpoint
      name="MyService"
      address="http://prodserv/MyService.svc"
      binding="basicHttpBinding"
      bindingConfiguration="MybasicHttpBinding"
      contract="MyApp.MyService"
               /&gt;
  </code></pre>
  
  <p>In some way, i need the silverlight client to know which one to use, depending on which server its on / which build is compiled.</p>