Allow empty values in XMLUpdate
When trying to use XMLUpdate with an empty value, I receive the following errors:
[path-to-file]\build.msbuild(55,5): error : Value cannot be null.\r
[path-to-file]\build.msbuild(55,5): error : Parameter name: value
This is happening because I am using XMLUpdate to create environment-specific config files, and in some environments the values of a couple XML nodes are empty, leading to this error (see the example below).
This is something that didn't happen in earlier versions, so I'm wondering if a null check was removed from the implementation of XMLUpdate. And if that's the case, is there any reason it can't be restored?
Example:
<OccasionalyEmptyEnvValue></OccasionalyEmptyEnvValue>
<XmlUpdate
XmlFileName="$(DestinationConfig)"
XPath="//settings/setting[@key='EnvironmentConfigValue']/@value"
Value="$(OccasionalyEmptyEnvValue)" />
I could really use this so that I can set the runtime section of web configuration files to blank. The way I worked around it is by setting the value to a line break for my element. Unfortunately if I use delete on the contents of the runtime element it will produce a
Hey, I try to set value='%20' in XmlUpdate section, and it works. It shows value=" " in the file.