Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSDeploy SetParameters.xml create empty value

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)
like image 948
Talon Avatar asked Feb 02 '14 16:02

Talon


Video Answer


1 Answers

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>
like image 124
Neal Avatar answered Sep 28 '22 15:09

Neal