Created
July 23, 2012 20:09
-
-
Save hjerpbakk/3165934 to your computer and use it in GitHub Desktop.
Save config after
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ConfigurationFileMap = new ExeConfigurationFileMap() { ExeConfigFilename = "My.config" }; | |
var config = ConfigurationManager.OpenMappedExeConfiguration(ConfigurationFileMap, ConfigurationUserLevel.None); | |
if (config != null) | |
{ | |
// do stuff | |
config.Save(); | |
// Format XML | |
XDocument configXml = XDocument.Load(configuration.FilePath); | |
configXml.Save(configuration.FilePath, SaveOptions.None); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment