[Mono-list] Error while run program

Arx Henrique arxcruz@yahoo.com.br
Mon, 02 Aug 2004 22:03:42 -0300

Hi all,

Sorry my english one more time
I'm have problems with mono when i try run a example that i see in one
book, they compile correct but when i run show this error:

Unhandled Exception: System.NullReferenceException: Object reference not
set to an instance of an object
in <0x000bc> DotNetXmlSample.XmlSample:Main (string[])

i dont know what is this
somebody can help me ?

i use debian unstable with mono 1.0

this is the code:

using System;
using System.Xml;

namespace DotNetXmlSample
	public class XmlSample
		static void Main(string[] args)
			XmlDocument SampleDoc = new XmlDocument();
			XmlNode RootNode = null;
			XmlNode RegionNode = null;
			XmlNode RegionDescription = null;
			RootNode = SampleDoc.DocumentElement;
			RegionNode = RootNode.ChildNodes[0];
			RegionDescription = RootNode.SelectSingleNode("description");
			RegionDescription.InnerText = "Reeeeeealy fast";

And this is the xml file

<?xml version="1.0"?>
  <category xmlns="prog">
    <address>one addres</address>
    <description>one description</description>
  <category xmlns="prog2">
    <address>two addres</address>
    <description>two description</description>

thanks a lot of

Arx Henrique