If you are using a parameters.xml file to set value with MSDeploy I have just found a gotcha. You need some value in the web.config file, not just an empty XML tag, else the replacement fails. So to explain…

I had the following parameters.xml file, and use Release Management to replace the __TAG__ values at deployment time.

<parameters>  
  <parameter name="Domain" description="Please enter the name of the domain" defaultvalue="\_\_Domain\_\_" tags="">  
    <parameterentry kind="XmlFile" scope="\\web.config$" match="/configuration/applicationSettings/Web.Properties.Settings/setting\[@name='Domain'\]/value/text()" />  
  </parameter>

  <parameter name="AdminGroups" description="Please enter the name of the admin group" defaultvalue="\_\_AdminGroups\_\_" tags="">  
    <parameterentry kind="XmlFile" scope="\\web.config$" match="/configuration/applicationSettings/Web.Properties.Settings/setting\[@name='AdminGroups'\]/value/text()" />  
  </parameter>  
</parameters>

If my web.config file (in the MSDeploy package to be transformed) was set to

<applicationSettings>  
    <Web.Properties.Settings>  
      <setting name="Domain" serializeAs="String">  
        <value>Blackmarble</value>  
      </setting>  
      <setting name="AdminGroups" serializeAs="String">  
        <value />  
      </setting>  
    </BlackMarble.ISS.Expenses.Web.Properties.Settings>  
  </applicationSettings>

or

<applicationSettings>  
    <Web.Properties.Settings>  
      <setting name="Domain" serializeAs="String">  
        <value>Blackmarble</value>  
      </setting>  
      <setting name="AdminGroups" serializeAs="String">  
        <value></value>  
      </setting>  
    </BlackMarble.ISS.Expenses.Web.Properties.Settings>  
  </applicationSettings>

only the Domain setting was set.

To get both set I had to have a value for each property, even though they were being reset at deployment.

<applicationSettings>  
    <Web.Properties.Settings>  
      <setting name="Domain" serializeAs="String">  
        <value>DummyDomain</value>  
      </setting>  
      <setting name="AdminGroups" serializeAs="String">  
        <value>DummyAdmins</value>  
      </setting>  
    </BlackMarble.ISS.Expenses.Web.Properties.Settings>  
  </applicationSettings>

Never seen that one before.