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

U

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top