title: Deploying shared server controls with web.config transforms
body: <p>I'm using <code>teamcity</code> to deploy our web application to several servers using <code>msbuild</code> and <code>webdeploy</code>.  </p>
  
  <p>I have a configuration per customer / environment combination - for example:</p>
  
  <pre><code>Internal-Dev
  Customer1-Test
  Customer1-Pilot
  Customer1-Live
  Customer2-Test
  Customer2-Pilot
  Customer2-Live
  </code></pre>
  
  <p>I only need these configurations so that the deployment process can use web.config transformations to set the appropriate connection strings and other settings for the installation.</p>
  
  <p>The problem that I have is that I have a shared web server controls project which really only needs two configurations - <code>debug</code> and <code>release</code> - but I need to copy all the above configurations into this project in order to get them to work.  If I delete <code>Customer2-Pilot</code> from the shared project, I can't deploy to customer 2's pilot server because it is looking for the <code>Customer2-Pilot</code> configuration for the shared project which doesn't exist.</p>
  
  <p>Currently, I copy the application's configuration names into the shared project but that is impractical as we have several applications each going to different customers so the shared project could get dozens of configurations which are all copies of <code>Release</code> or <code>Debug</code></p>
  
  <p>I would like to be able to configure the build system so that I can say that the <code>Internal-Dev</code> configuration of the web application project uses the shared project's <code>Debug</code> configuration and all the other configurations use the shared project's <code>Release</code> configuration.  This is possible from within the IDE, using the configuration manager which can tie a solution configuration to individual project configurations but I'm not sure how to do this from within <code>teamcity</code>.</p>
  
  <p>My current teamcity configuration is using the <code>MSBuild</code> runner with the web application's <strong>project</strong> file as the build file path and the configuration parameters set to deploy it to the relevant server with the correct configuration after it has been built.  The shared project is in a sub-repository of the web application repository so it is fetched and built automatically.</p>
  
  <p>Is there any way that I can change this set up to get what I want?  Do I need to change the build file path to be the solution instead of the project so that I can use the configuration manager settings to configure it?</p>