I have a code snippet :
XmlDocument doc = new XmlDocument();
try
{
doc.LoadXml(xmlPath);
}
catch (Exception ex)
{
string exMessage = ex.Message;
}
Use doc.Load(xmlPath). LoadXML is for loading an XML string.
does xmlPath contains the whole xml or a path to a file that contains it? The LoadXml method expects the actual XML, not a path to a file. If you want to load the xml using a path, using the Load method.
You're passing a file path to a parameter that should contain the XML itself.