1

I have a web project and I craeted a Test publish configuration. I use Web Deploy Package for publish method. My target is to have a replacable parameter for a setting in appSettings, so that on deployment a new setting value would be used in SetParameters.xml. I use parameters.xml file created in the root project folder with the following structure.

parameters.config

<parameters>
  <parameter name="webApiUrl"
             defaultValue="http://localhost:50594/">
    <parameterEntry
      kind="XmlFile"
      scope="Web.config"
      match="/configuration/appSettings/add[@key='webApiUrl']/@value" />      
  </parameter>
</parameters>

Web.config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <appSettings>
        <add key="webApiUrl" value="http://localhost:50594/" />
    </appSettings>
</configuration>

The problem is that when the project is published the webApiUrl setting is not changed to $(ReplacableToken_webApiUrl) so when the project is deployed the value in SetParameters.xml is not taken into consideration.

I used a lot of different variations of scope and match, but non of them worked. scope="\Web.config$", "obj\x86\Test\Package\PackageTmp\Web.config$", "\Web.config$", "\web.config$"

When I publish the project I check the folder (ProjectRoot)\obj\x86\Test\Package\PackageTmp\Web.config to see if the parametrization works.

  • 1
    I have a very similar problem, have you found a solution please? https://stackoverflow.com/questions/41182901/web-config-not-being-parametrized-on-deploy – kerray Dec 19 '16 at 11:58

0 Answers0