Settings with serializeas="xml" aren't regurgitated correctly

In my web.config, I have a setting which contains XML, similar to the below:
@@@






`
@@@

I’ve added a Variable to my deployment which should replace this setting, however the actual value which ends up in web.config seems to be escaped, so, instead of:
@@@

@@@
I end up with:
@@@
<bar><someNode name=“deployed” /> etc etc
@@@

Is there a workaround for this until it’s fixed?

Thanks,
Dan

oops - this should probably go in the ‘problems’ forum. Can a moderator move this, please?

Hi Dan,

This is a side effect of the current design. Normally with variables people expect to enter the unescaped value; that’s because the same variable value might be used in PowerShell scripts, in IIS paths, and so on. So when we swap values into XML we perform the escaping for you.

The only workaround would be to use your Deploy.ps1 script and have PowerShell modify the config file and swap the values in.

Hope that helps,

Paul

Paul,
Will this be available in OD 2.0? Even better would be transformation/substitution of any XML file in the package.

We’ve got a workaround for now - serialize it as text, and unescape it if required in our app as we load in the settings.

A more elegant long term solution (without resorting to scripting) would be fantastic, though!

Thanks,
Dan

Hi Dan,

We really should be smart enough to see “serializeAs=xml” and take that into account when setting the value. I’ll try to do this in a future release.

Paul