I'm using an XML-Document-Transform to transform my web.config file for deployment to a staging server. Unfortunately it isn't transforming exactly as specified and is adding some whitespace to an element's text. This whitespace is then being picked up by the Castle Windsor configuration that I use and bombing the application.
Here's an example:
web.config:
<configuration>
<castle>
<properties>
<serverUrl>http://test</serverUrl>
<properties>
<components>
<component id="MyService">
<parameters>
<Url>#{serverUrl}/MyService.asmx</Url>
</parameters>
</component>
</components>
<castle>
<configuration>
web.staging.config:
<configuration>
<castle>
<properties>
<serverUrl xdt:Transform="Replace">http://staging</serverUrl>
<properties>
<castle>
<configuration>
Output web.config:
<configuration>
<castle>
<properties>
<serverUrl>http://staging
</serverUrl>
<properties>
<components>
<component id="MyService">
<parameters>
<Url>#{serverUrl}/MyService.asmx</Url>
</parameters>
</component>
</components>
<castle>
<configuration>
As you can see additional whitespace has been inserted in to the serverUrl
element by the transformation.
Unfortunately Castle includes the whitespace when inserting the serverUrl
into the Url
of the service which creates an invalid URL.
Anyone else come across this? Anyone got a solution that still uses the new Microsoft transformation method but doesn't cause additional whitespace to be inserted?
IMHO this is a bug in the transform process although Castle should probably be ignoring the whitespace too.
Many thanks, Rob