This project is read-only.

Updating configuration files with environment specific values

Jan 13, 2011 at 4:08 PM
Edited Jan 13, 2011 at 4:09 PM


I would like to update a BizTalk 2010 configuration file with environment specific values so that I can have one configuration file that I can run with different values for dev/test/production.

For ex.

    <SQL ID="xxxxxxxxx" DisplayName="BizTalk Management Database" Description="This database is the central meta-information store for all BizTalk Servers.">
      <Server><Environment Specific Server name goes here></Server>
      <Database>Environment Specific Database name goes here></Database>
      <WindowsSecurity Editable="no">yes</WindowsSecurity>
      <UserName />
      <Password />


It is a fairly common task and I am aware of several options and would like to pick the easiest one to work with. Here are some

How do you currently handle this task in your environment? What are some of the things you like/dislike about your current approach?



Jan 14, 2011 at 4:37 PM

I use 

  • MSBuild.ExtensionPack.FileSystem.Detokenise class

extensively for this scenario. I should prob blog something...


Jan 14, 2011 at 8:16 PM

Is there way to provide replacement values from an external file? For example I have a file that contains environment specific values called Dev.ConfigValues.xml. Note that some values in the top section may be used more than once but I would like to have the actual value in one location only.


<Project ToolsVersion="4.0" DefaultTargets="Default" xmlns="">
	    <BtsOperators>BizTalk Server Operators</BtsOperators>


I would like to take the values above and merge it with the BizTalkConfig_Template.xml file that looks like this.


         <NTAccount ScopeType="105" UpLevelFlags="672" DownLevelFlags="2147483654">$(BTS_HOST_GROUP)</NTAccount>
        <Name ID="BTS_HOST_NAME" DisplayName="Ho&amp;st name:" Description="Name of the In-Process BizTalk  host (eg, BizTalkServerApplication)" Hidden="false">
        <NTService ID="{B64F63FA-E24E-4991-86F0-ED9F65B68A98}" DisplayName="BizTalk Host Instance Account" Description="Windows account with access to a specific In-Process BizTalk host instance. This account will be given Log on as Service rights.">


I guess I can convert the my values into the following format, put them in a separate project file and import that project file into the file that calls the Detokonize class. Any alternative ideas on Detokenize class usage?

            <TokenValues Include="Title">
            </TokenValues >
            <TokenValues Include="ProjectHome">
            </TokenValues >