Home All Groups Group Topic Archive Search About

How can I serialize complex types to the mapped exe configuration file.

Author
19 Jan 2006 6:44 PM
Umut Tezduyar
ExeConfigurationFileMap fileMap = new ExeConfigurationFileMap();

fileMap.ExeConfigFilename = "FactorySettings.config";

Configuration config =
System.Configuration.ConfigurationManager.OpenMappedExeConfiguration(fileMap,
ConfigurationUserLevel.None);

CustomConfiguartionSection section =
(CustomConfigurationSection)config.GetSection (sectionName);

After I took the custom section from Configuration by using
config.GetSection(string sectionName), I want to serialize complex object to
that section. Is there a way to to this? I don't want to use attributes.
Just what I want to do is, to serialize my object using
System.XML.Serialization.XMLSerializer.

PS: I tried to overload serialize and deserialize of my
CustomConfigurationSection but they didn't work.
PS: The configuration logic for Enterprise Libarary 1.? was working like
that.

Thanks.

AddThis Social Bookmark Button