“Data at the Root Level is invalid” with LoadXml

前端 未结 3 1966
傲寒
傲寒 2021-01-24 09:32

I have a code snippet :

XmlDocument doc = new XmlDocument();
try
{
    doc.LoadXml(xmlPath);
}
catch (Exception ex)
{
    string exMessage = ex.Message; 
}
         


        
3条回答
  •  灰色年华
    2021-01-24 10:00

    You're passing a file path to a parameter that should contain the XML itself.

提交回复
热议问题