4

I use webdeploy to deploy my web site project with a parameters.xml file I have been using a for a while. So far the parameters I've added are all element attributes and it all works well. But I am trying to get the xpath right to update an applicationSettings element value (not attributes) and am failing, badly, to work out if its my poor xpath skills to blame or a misunderstanding of the way the parameters file works.

When I do a deployment the field is not updated, it compiles fine and no errors\warnings during deployment. I want to be able to set this to True or False.

So I have following parameters field

<parameter name="ShowExceptionCallStackOnErrorView" description="Display a call stack on the UI Error view - true for debug only." defaultValue="False" tags="">
    <parameterEntry kind="XmlFile" scope="\\web.config$" match="/configuration/applicationSettings/abc.123.Properties.Settings/setting[@name='ShowExceptionCallStackOnErrorView']/value" />
</parameter>

trying to match to the following application settings section

<configuration>
    <applicationSettings>
        <abc.123.Properties.Settings>
            <setting name="ShowExceptionCallStackOnErrorView" serializeAs="String">
               <value>True</value>

Any help would be much appreciated!

1 Answer 1

7

It's not giving you an error because it is simply not finding a match to replace. You need to add /text() to the end of your match tag if you want it to replace the contents of the value tag. As follows...

<parameter name="ShowExceptionCallStackOnErrorView" description="Display a call stack on the UI Error view - true for debug only." defaultValue="False" tags="">
  <parameterEntry kind="XmlFile" scope="\\web.config$" match="/configuration/applicationSettings/abc.123.Properties.Settings/setting[@name='ShowExceptionCallStackOnErrorView']/value/text()" />
</parameter>
Sign up to request clarification or add additional context in comments.

2 Comments

Did this work for the original poster? I'm troubleshooting a similar issue.
I got this to work (using /text()). My problem was I used match="//applicationSettings..." instead of match="/configuration/applicationSettings..."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.