سؤال

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)
هل كانت مفيدة؟

المحلول

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>

نصائح أخرى

So, by pure chance I tried entering a single empty space and it worked. If there is a better way I am still eager to learn more...

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top