PDA

Click to See Complete Forum and Search --> : ConfigurationSection vs XML Serialization


Jumpercables
Feb 4th, 2009, 10:00 AM
I'm developing an application that will use a XML configuration file as the main engine for holding information that is required for the application.

I had planned on using the .NET 2.0 configuration sections and developing custom ConfigurationSections and ConfigurationElements. But it got me thinking of what are the benefits of technology versus using an XSD Schema to create a serializable class that could load the XML.

What are the benefits of using the .NET 2.0 ConfigurationSections / ConfigurationElements versus XML Serialization?

Thanks

Shaggy Hiker
Feb 4th, 2009, 10:30 AM
Here's the cynical answer: XML is open to anybody. ConfigurationSections tie you to MS.

Another option you might consider is binary serialization. It is somewhat easier to use than XML serialization, and works for all types, whereas XML serialization doesn't work (easily) for generics and some other types. XML would be readable/editable with a text editor, while binary files are not. That's pretty much the trade-off between those two.