[Mono-bugs] [Bug 521231] New: System.Configuration skips xml nodes when reading two ConfigurationElementCollections in a row.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Jul 10 16:57:58 EDT 2009


           Summary: System.Configuration skips xml nodes when reading two
                    ConfigurationElementCollections in a row.
    Classification: Mono
           Product: Mono: Class Libraries
           Version: SVN
          Platform: x86-64
        OS/Version: Ubuntu
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Configuration
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: greg.smolyn at strangeloopnetworks.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:
Gecko/2009060309 Ubuntu/9.04 (jaunty) Firefox/3.0.11

When reading two ConfigurationElementCollections in a configuration string, the
system will fail with a Unrecognized element exception.

For example,
  <foos><foo id="1" /></foos>
  <bars><bar id="1" /></bars>

It will read the first 'foos' collection properly, but then will skip the
<bars> element and go straight to the first <bar> element, causing an

It seems there may be too many reader.Read() or Skip() calls in the
ConfigurationElement.Deserialize() class.

Reproducible: Always

Steps to Reproduce:
1. Compile the supplied main file (untar and run xbuild on ConfigTest.csproj)
2. Execute and an exception will occur
Actual Results:  
Unhandled Exception: System.Configuration.ConfigurationErrorsException:
Unrecognized element 'bar'. (line 1)
  at System.Configuration.ConfigurationElement.DeserializeElement
(System.Xml.XmlReader reader, Boolean serializeCollectionKey) [0x002eb] in
  at System.Configuration.ConfigurationSection.DoDeserializeSection
(System.Xml.XmlReader reader) [0x000cc] in
  at System.Configuration.ConfigurationSection.DeserializeSection
(System.Xml.XmlReader reader) [0x00000] in
  at ConfigTest.FooConfigSection.Load (System.String xml) [0x00014] in
  at ConfigTest.MainClass.Main (System.String[] args) [0x0000c] in

Expected Results:  
No exception.

Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list