title: Build once and deploy to multiple environments with msdeploy & Visual Studio 2012
body: <p>Working on centralizing configurations, app settings and connection strings, for multiple solutions, while also switching over to use msdeploy from command line to deploy web apps.  Ideally I would want to build the packages once, and get up-to-date configurations as the packages are deployed to each environment.  I need some advice on the best approach to take.  </p>
  
  <ol>
  <li>Use Parameters.xml and SetParameters.xml file to dynamically swap out settings and connection strings.  See <a href="http://vishaljoshi.blogspot.com/2010/07/web-deploy-parameterization-in-action.html" rel="noreferrer">http://vishaljoshi.blogspot.com/2010/07/web-deploy-parameterization-in-action.html</a></li>
  <li>Use machine.config or server level web.config files to store common app settings and connection strings.</li>
  <li>Use packageweb NuGet package from <a href="https://github.com/sayedihashimi/package-web" rel="noreferrer">https://github.com/sayedihashimi/package-web</a> which enables using web.config transforms with msdeploy.</li>
  <li>Use file or configSource attributes along with SetParameters to point to different config files, but must be relative from web root.</li>
  <li>Use publish profiles.  See
  <a href="https://stackoverflow.com/questions/11683243/deploying-an-existing-package-using-publish-profiles">Deploying an existing package using publish profiles</a></li>
  </ol>
  
  <p>Thanks</p>