I`m writing an application that can be updated from remote server. Application config file is updating too (adding new sections etc...)
When application is updating i make a copy of old config file and then overwrite it. Values in new config file then restored from old file:
Expand|Select|Wrap|Line Numbers
- setNew.Value.ValueXml.InnerXml = setOld.Value.ValueXml.InnerXml;
after this new file is written:
Expand|Select|Wrap|Line Numbers
- configNew.Save(ConfigurationSaveMode.Minimal, true);
if old value (for example Password) is an empty string it write to xml file like this
<setting name="Password" serializeAs="St ring">
<value>
</value>
this value will be read as carriage return symbol and some spaces.
When I`m changing it manually to this:
<setting name="Password" serializeAs="St ring">
<value></value>
or this:
<setting name="Password" serializeAs="St ring">
<value/>
value will be read as empty string(which is needed)
How can I force xml serialization mechanizm to use these variants of notation(for empty values)?
Pls help.