[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


http://bugzilla.novell.com/show_bug.cgi?id=521231


           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:1.9.0.11)
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,
<fooconfig>
  <foos><foo id="1" /></foos>
  <bars><bar id="1" /></bars>
</fooconfig>

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
exception.

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
3.
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
/home/strangeloop/src/mono-137698/mcs/class/System.Configuration/System.Configuration/ConfigurationElement.cs:372 
  at System.Configuration.ConfigurationSection.DoDeserializeSection
(System.Xml.XmlReader reader) [0x000cc] in
/home/strangeloop/src/mono-137698/mcs/class/System.Configuration/System.Configuration/ConfigurationSection.cs:182 
  at System.Configuration.ConfigurationSection.DeserializeSection
(System.Xml.XmlReader reader) [0x00000] in
/home/strangeloop/src/mono-137698/mcs/class/System.Configuration/System.Configuration/ConfigurationSection.cs:188 
  at ConfigTest.FooConfigSection.Load (System.String xml) [0x00014] in
/home/strangeloop/src/ConfigTest/Main.cs:26 
  at ConfigTest.MainClass.Main (System.String[] args) [0x0000c] in
/home/strangeloop/src/ConfigTest/Main.cs:15 

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