Using CTT to modify config files for different environments

We previously tried to use msbuild to adjust configuration files for different environments.

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
Advertisements

Bookmarking for e-reading devices(Kindle and IPad)

Our family has Kindle and IPad, and periodically I had to use one or another.

Normally I prefer IPad, but Kindle has 2 advantages –   on a light sun it’s much easy to read Kindle screen, and it also have free free wireless internet(but browser is quite limitted),when for my IPad wi-fi is required.
        

 A few months ago I’ve wrote a  post about Kindle and ability to transfer articles using Instapaper  add-on http://www.wordcycler.com/help.html. I beleive that it’s the most convinient way to pass html files to Kindle.
   For iPhone and iPad I love ReadItLater. It saves any articles from web site on iPad Safary.
  When you reading inside RIL, you can click on any link and ask to “Read it later” and continue with the main article. Previously In Safary new link was opened in a new tab and it became current, which interrupted reader from the main article.It has been gixed in the latest version of Safary.