I've been making some headway using Web Deploy packages that transform web.config files on deploy rather than build. The goal in this is "build once, deploy everywhere". The problem I'm having is when I need to add or change complex XML in a web.config.
For example, if my base web.config contains this:
<customSection>
</customSection>
I might want to the deployed web.config to look like this:
<customSection>
<someSettingKey>QA Setting</someSettingKey>
</customSection>
It seems to work to have my SetParameters.xml look something like:
<setParameter name="customSection" value="<someSettingKey>QA Setting</someSettingKey>" />
But that seems a bit cumbersome, especially when the XML gets more nested / complex.
Are there better ways of doing this?