I'm getting rid of web.config configuration batch file (Hanselman's) and want to use the config transformation feature in vs2010. However I'm having a bit of trouble figuring out of to transform an xml element (as opposed to an attribute on an element).
This is a snippet from my web.config:
<Federation type="..." xmlns="...">
<SigningCertificate .../>
<AllowedAudienceUris>
<Audience>https://audience.url.com</Audience>
</AllowedAudienceUris>
</Federation>
I want to transform the element by inserting a different url based on the build configuration - can this be done?
Thanks in advance!
/Jasper
If the AllowedAudienceUris and Audience elements occur only once, omitting the xdt:Locator
is also fine:
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<Federation>
<AllowedAudienceUris xdt:Transform="Replace">
<Audience>https://example.com</Audience>
</AllowedAudienceUris>
</Federation>
</configuration>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With