MSDeploy SetParameters.xml create empty value

msdeploy, publish

Solution

Have to tell MSDeploy that it is okay for the value to be empty ...

<parameter name="SEND_TO_FRIEND_BCC" description="Email address of developer" defaultValue="" tags="">
   <parameterValidation kind="AllowEmpty" />
   <parameterEntry kind="XmlFile" scope"\\web.config$" match="/configuration/appsettings/add[@key='SEND_TO_FRIEND_BCC']/@value" />
</parameter>

Problem

So my question is relatively simple. In my Parameters.xml file I have the following line: ``` <parameter name="SEND_TO_FRIEND_BCC" description="Email address of developer" defaultValue="" tags=""> <parameterEntry kind="XmlFile" scope"\\web.config$" match="/configuration/appsettings/add[@key='SEND_TO_FRIEND_BCC']/@value" /> </parameter> ``` When publish this is creating a file that ends up like this: ``` <setParameter value="" name="SEND_TO_FRIEND_BCC" /> ``` When going live, this should replace the current web.config value for SEND_TO_FRIEND_BCC to an empty string. Instead, when I try an publish I get the following: ``` Error: The 'SEND_TO_FRIEND_BCC" argument cannot be null or empty. Error count: 1. at InRelease.MSDeploy.Program.Main(String[] args) ```

Original source