title: WCF Service @ N-Tier App: Switching between development/production?
body: <p><strong>Context</strong></p>
  
  <p>We have developed the application from end-to-end using .NET Stack. So, let's say we are managing something like this:</p>
  
  <p>WPF Client &lt;=> Web Service:</p>
  
  <ol>
  <li>Development) Plain reference (direct calls to the WCF Service project inside VS, not deployed in IIS)</li>
  <li>Production) Remote Web Service [IIS @ remote server, need VPN to connect]</li>
  </ol>
  
  <p>Web Service &lt;=> Database:    </p>
  
  <ol>
  <li>Development) SQL Server Express local DB [@ development machine]   </li>
  <li>Production) SQL Server DB [@ production server, same as WS]</li>
  </ol>
  
  <p>Notice that I've implemented it "The manual way, the right way" (<a href="http://www.code-magazine.com/Article.aspx?quickid=0809101" rel="nofollow">http://www.code-magazine.com/Article.aspx?quickid=0809101</a>). Hence, separate contracts / client proxies and so on ...</p>
  
  <p><strong>Question</strong></p>
  
  <p>How could I get a set-up like described before in an elegant way? I mean, the web service &lt;=> database it's trivial, since I can use the web.config transformations in order to switch the connection string between debug &amp; release. But, <strong>how can I automatically switch the "connection" from the client app to the Web Service?</strong></p>
  
  <p>In production I'm using a reference to the proxies, and describing an end-point in the app.config file. I guess that in development I would just need a plain reference to the web service itself. [Should I add/remove references between debug/release configurations? If yes, how could this be achieved programatically? ... I'm completely lost]. </p>
  
  <p><strong>Thank you for your time guys! ;)</strong></p>
  
  <p>EDIT:</p>
  
  <p>As @AlexanderBalte suggests, the development behavior is just a direct call of methods. I don't have an app server in the main development machine.</p>