Reputation: 538
I have just started using web.config transformation and I am able to apply successfully replace transformation. however I am struggling with little more complex transformation such as
<downloadHandlers>
<add name="FileDownload" path="~/Download.ashx">
<tcpDownloadEndpoint endpointIPAddress="127.0.0.1" endpointPort="8100" />
</add>
</downloadHandlers>
I have the following line in the transformation file to replace the local IP with UAT IP for UAT env.
<tcpDownloadEndpoint
endpointIPAddress="127.127.0.1"
xdt:Transform="SetAttributes(endpointIPAddress)">
</tcpDownloadEndpoint >
But the above code has no effect and the IP in the web.config still contains the local IP after transformation.
I am using Visual Studio 2010 with web.config transformation plugin written by Syed Hashmi (MS).
Can any one please tell me what I am doing wrong.
thanks
Upvotes: 0
Views: 172
Reputation: 39888
You should use the following in your transformation web.config:
<downloadHandlers>
<add name="FileDownload" path="~/Download.ashx">
<tcpDownloadEndpoint
endpointIPAddress="127.127.0.1"
xdt:Transform="SetAttributes(endpointIPAddress)">
</tcpDownloadEndpoint >
</add>
</downloadHandlers>
You need to use the complete XML node hierarchy when specifying a transform. By removing the outer nodes, the web.config transformation can't find the exact node that you want to transform.
Upvotes: 1