ConfigurationElementCollection does not save correclty

  • Thread starter Thread starter John Bailey
  • Start date Start date
J

John Bailey

I have a configuration that is defined as such:

<sampleSection defaultItem="name" xmlns="http://www.baileysc.com/sample">
<sampleItems>
<sampleItem itemName="name" customData="xxx" />
<sampleItem itemName="name2" customData="xxx2" />
</sampleItems>
</sampleSection>

I have created classes to read/write the configuration section by deriving
from ConfigurationSection, ConfigurationElement and
ConfigurationElementCollection. The code reads the configuration perfectly,
but when writing the configuration it writes:

<sampleSection defaultItem="name" xmlns="http://www.baileysc.com/sample">
<sampleItems itemName="name" customData="xxx"
itemName="name2" customData="xxx2" />
</encryptionSection>

Does anyone have an idea of what could be going wrong here?
 
I have a configuration that is defined as such:

  <sampleSection defaultItem="name" xmlns="http://www.baileysc.com/sample">
    <sampleItems>
      <sampleItem itemName="name" customData="xxx" />
      <sampleItem itemName="name2" customData="xxx2" />
    </sampleItems>
  </sampleSection>

I have created classes to read/write the configuration section by deriving
from ConfigurationSection, ConfigurationElement and
ConfigurationElementCollection.  The code reads the configuration perfectly,
but when writing the configuration it writes:

    <sampleSection defaultItem="name" xmlns="http://www.baileysc.com/sample">
        <sampleItems itemName="name" customData="xxx"
itemName="name2" customData="xxx2" />
    </encryptionSection>

Does anyone have an idea of what could be going wrong here?

Did you ever figure out what was causing the described behavior? I'm
having a similar issue.

Thanks,

James
 
Back
Top