locked
MSDeploy not replacing encoded xml strings RRS feed

  • Question

  • User726754636 posted

    I was redirected here from https://social.msdn.microsoft.com/Forums/en-US/472218ac-9959-4b87-81f0-a1fe83448c64/msdeploy-not-replacing-encoded-xml-strings?forum=msbuild

    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>
    </applicationSettings>

    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()" />
    </parameter>

    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?

    Friday, June 9, 2017 9:37 AM

All replies