Quantcast
Viewing all articles
Browse latest Browse all 8156

After saving System.Configuration.Configuration, are changed

hi,

strange problem:

after caling the Save method all my <value> elements which previously were empty conatin a "\r\n". i changed my code in that way, that i just open and save the configuration file, but the values are still changed.
Can someone tell me why and how to avoid this?

System.Configuration.ExeConfigurationFileMap map = new System.Configuration.ExeConfigurationFileMap();
map.ExeConfigFilename = "app.config";

System.Configuration.Configuration config = System.Configuration.ConfigurationManager.OpenMappedExeConfiguration(map, System.Configuration.ConfigurationUserLevel.None);
config.Save(ConfigurationSaveMode.Modified, true);
app.config before:<MyApp.Properties.Settings><setting name="Setting" serializeAs="String"><value></value></setting></MyApp.Properties.Settings>


app.config after:

<MyApp.Properties.Settings><setting name="Setting" serializeAs="String"><value></value></setting></MyApp.Properties.Settings>



Viewing all articles
Browse latest Browse all 8156

Trending Articles


FLASHBACK WITH SIRASA FM AT GALGAMUWA 2022


Mp3 Download: Mdu - Mazola


Imitation gun was fired at motorist in Leicester road-rage incident


Ndebele names


MCKINNEY EMALINE “EMMA” OF WES...


Okra & Motia — The Workshop (Prod by Hammer)


Skint TV teen to be sentenced


Moondru Mudichu 19-09-2017 – Polimer tv Serial


YOSVANI JAMES Arrested by Miami-Dade County Corrections on Jan 10, 2017


Stories • Goddess Stepmom



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>