[Mono-bugs] [Bug 598593] New: System.NullReferenceException when trying to load an XmlDocument using an XmlTextReader.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Apr 21 13:54:05 EDT 2010



           Summary: System.NullReferenceException when trying to load an
                    XmlDocument using an XmlTextReader.
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.6.x
          Platform: i586
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: Sys.XML
        AssignedTo: atsushi at ximian.com
        ReportedBy: nickntg at hotmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:
Gecko/20100401 Firefox/3.6.3

When trying to load an instance of XmlDocument using an XmlTextReader I
consistently get an exception.

Code used to reproduce behavior:
Imports System

Public Class Application
    Public Shared Sub Main()    
        Dim reader as new Xml.XmlTextReader("test.xml")
        reader.WhiteSpaceHandling = Xml.WhitespaceHandling.All

        dim doc as new xml.xmldocument
    End Sub
End Class

XML file contents:
<?xml version="1.0" encoding="utf-8" ?> 
    <ConsolePort value="9998" />

Reproducible: Always

Steps to Reproduce:
1. Compile the short program.
2. Place XML contents in test.xml file in the same path as the compiled
3. Run the program.
Actual Results:  
Unhandled Exception: System.NullReferenceException: Unexpected node type
  at System.Xml.XmlDocument.ReadNodeCore (System.Xml.XmlReader reader)
[0x0034a] in
  at System.Xml.XmlDocument.ReadNode (System.Xml.XmlReader reader) [0x00032] in
  at System.Xml.XmlDocument.Load (System.Xml.XmlReader xmlReader) [0x00019] in
  at testXML.Application.Main () [0x00026] in

Expected Results:  
XmlDocument loaded.

Running under openSUSE 11.2. Code compiled using MonoDevelop 2.2.2.

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

More information about the mono-bugs mailing list