MSDeploy not replacing encoded xml strings
Asked Answered
I

0

10

In web.config I have:

<applicationSettings>
<App.Properties.Settings>
    <setting name="ProfitConnectorToken" serializeAs="String" xdt:Transform="Replace" xdt:Locator="Match(name)">
        <value>__ProfitConnectorToken__</value>
    </setting>
</App.Properties.Settings>

In my parameters.xml:

<parameter name="ProfitConnectorToken" description="Description for ProfitConnectorToken" defaultvalue="__PROFITCONNECTORTOKEN__" tags="">
<parameterentry kind="XmlFile" scope="\\web.config$" match="/configuration/applicationSettings/App.Properties.Settings/setting[@name='ProfitConnectorToken']/value/text()" />

And in my SetParameters.xml:

<setParameter name="ProfitConnectorToken" value="&lt;token&gt;&lt;version&gt;1&lt;/version&gt;&lt;data&gt;XXXXXXXXXXXXXXXXXXXXXXXXX&lt;/data&gt;&lt;/token&gt;" />

But this value is not set when the web application is deployed. When I change my SetParameters.xml to:

<setParameter name="ProfitConnectorToken" value="TEST" />

It does work, so my XPath is correct. Why is the encoded xml value not set?

Introduction answered 8/6, 2017 at 11:2 Comment(2)
Try removing /text() at the end of your XPath query?Ehudd
Nope, if I do that the value isn't replaced at all, not even my "TEST" value which was working before.Introduction

© 2022 - 2024 — McMap. All rights reserved.