There are a couple of things that i strongly dislike about the Web.config transformation in VS2010

  • Only works with XML files (eg: Can’t be used to generate a release notes.txt file)
  • Does not seem to support externalized sections, eg: log4net.config in a separate file
  • No support to copy/paste transform files
  • Only works when Visual Studio 2010 is installed (And i am still not convinced a build server should have this).
  • Ties environment to build configuration

Lesson learned: Don’t trust your co-workers, always double-check!

  • Having multiple transformations is easy-peasy, just invoke the TransformXml task for all your config files and make sure your transformation files are correct. For log4net this would look like
<log4net xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
	<root>
		<level value="ERROR" xdt:Transform="Replace"/>
	</root>
</log4net>
  • The support for copy/paste can be achieved by removing the DependentUpon tag in your proj file (At the cost that you do not have the + sign in solution explorer which ‘hides’ the transforms files)