Recently I found
C
onfig Transformation Tool(CTT) on CodePlex
and with
addition of global replace using powershell
it is enough and easier to do all required modifications
Content of ChangeConfig.cmd:
ctt s:..web.config t:WebConfig.CTT d:..web.config
powershell.exe -command “Get-Content ..Remoting.config | ForEach-Object { $_ -replace ‘//localhost/ServicesCI/’, ‘//ServerName01/ServicesCI/’ } | Set-Content ..remoting.temp”
powershell.exe -command “copy ..remoting.temp ..remoting.config”
ctt s:..EnterpriseLibraryLogging.config t:EnterpriseLibraryLogging.CTT d:..EnterpriseLibraryLogging.config
@goto end
@rem some code that currently not used
:End
@pause
Content of example
WebConfig.CTT
:
<?
xml
version=”1.0″?>
<
configuration
xmlns:xdt=”http://schemas.microsoft.com/XML-Document-Transform”>
<
appSettings
>
<
add
key=”ShowDeveloperExceptionInfo” value=”False” xdt:Transform=”Replace” xdt:Locator=”Match(key)” />
</
appSettings
>
<
system.diagnostics
>
<
sharedListeners
>
<
add
name=”ServiceModelMessageLoggingListener” initializeData=”C:temptestCIcopy2.svclog” xdt:Locator=”Match(name)” xdt:Transform=”SetAttributes(initializeData)” />
</
sharedListeners
>
</
system.diagnostics
>
</
configuration
>
Extract from web.config –
sharedListeners section
<
sharedListeners
>
<
add
initializeData=”C:tempTEST.svclog” type=”System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089″ name=”ServiceModelMessageLoggingListener” traceOutputOptions=”Timestamp”>
<
filter
type=”” />
</
add
>
</
sharedListeners
>v