I want to create a Configuration object from an xml string or stream rather than a file. But as far as I can see, the ConfigurationManager requires a file path to instantiate a Configuration object. Does anyone know a way of creating a Configuration object from something other than a file?
Just save the stream to a file using System.IO and load it with
ConfigurationManager.OpenMappedExeConfiguration(new ExeConfigurationFileMap(filename))
http://msdn.microsoft.com/en-us/library/system.configuration.configurationmanager.openmappedexeconfiguration(v=VS.90).aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With