views:

117

answers:

1

I am using the CSD tool to create custom configuration sections in my asp.net 3.5 web application. I have no problem with setting up the section, elements, and collections. However, when I create new instances of these to represent what I need to persist to the file system, I cannot obtain the resultant XML. I'm hoping somebody may have ran across this before as well.

An example of the code I'm using that should return the XML is below. MyCustomConfiguration inherits from ConfigurationSection automatically via the CSD generation tool

MyCustomConfiguration.SectionInformation.GetRawXml()

Sample XML output that should be modeled is below. The instances I create programatically to model this are perfect but no matter what my output is blank.

<myCustomConfiguration ...>
    <friends>
        <name ... />
        <name ... />
    </friends>
</myCustomConfiguration>
A: 

Figured this one out on my own moments ago. Turns out I needed to serialize from base rather than the method described above.

string test = base.SerializeSection(this, "myCustomConfiguration", ConfigurationSaveMode.Full);
Jakkwylde