MSDeploy setParameter.xml not transforming web.config RRS feed

  • Question

  • User16290778 posted

    In my "myconfig" config profile transform for web.config i have this under appSettings:

    <add key="my.config" xdt:Transform="SetAttributes" xdt:Locator="Match(key)" value="derp" />

    When I msbuild with this transform the value is transformed correctly. Now I want to build an msdeploy package and transform this value at deploy time.

    I drop this parameters.xml in my project root:

    <?xml version="1.0" encoding="utf-8" ?>
        <parameter name="my.config" description="sdfsdfsdfsd" defaultValue="fart">
            <parameterEntry kind="XmlFile"
                            match="/configuration/appSettings/add[@my.config]/@value/text()" />

    I build my package

    msbuild app.csproj /T:Package /p:Configuration=myconfigprofile;PackageLocation=mydeploy.zip

    I look at mydeploy.SetParameters.xml

    <?xml version="1.0" encoding="utf-8"?>
      <setParameter name="IIS Web Application Name" value="Default Web Site/myApp_deploy" />
      <setParameter name="my.config" value="fart" />

    Then I go into parameters.xml inside of mydeploy.zip and see its there too:

      <parameter name="my.config" description="sdkflsdjfldfj" defaultValue="fart">
        <parameterEntry kind="XmlFile" scope="\\Web\.config$" match="/configuration/appSettings/add[@name='my.config']/@value/text()" />

    looks good so far, then i deploy:

    mydeploy.deploy.cmd /Y /M:server1

    I look at web.config on the deploy server and the value is not transformed. I see errors at all either, how do i debug this even? Also very confused about scope and match and what the current working directory is here.

    Tuesday, April 10, 2018 7:04 PM

All replies