c# - comments are getting deleted while updating the web config file programmatically -
comments , keys getting deleted while updating web.config problematically
string path = configurationmanager.appsettings["path"]; var map = new execonfigurationfilemap { execonfigfilename = path }; var configfile = configurationmanager.openmappedexeconfiguration(map, configurationuserlevel.none); configfile.appsettings.settings["strkeyname"].value = convert.tostring(intvalue); configfile.save();
may know why happening that, want retain comments .please let me know how can achieve it.
Comments
Post a Comment