المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : .loadXml throwing exception



C# Programming
08-27-2009, 10:11 PM
Hello All;

I am getting an exception when trying to load my XML file with C#.

Here is my XML:



AutoCAD MEP 2009
ShopData Old


And the code to load it:

XmlDocument test = new XmlDocument();
if (File.Exists(supportDir + "\\LaunchCAD.xml"))
{
test.LoadXml(supportDir + "\\LaunchCAD.xml");
}

The load line is giving me this exception:
An unhandled exception of type 'System.Xml.XmlException' occured in System.Xml.dll
Additional Information: Data at the root level is invalid. Line 1, position 1.

I can't tell what I am doing wrong...

Thanks in advance.