0

Getting above error while loading a local XML file. In app setting, I am using below path.

<add key="Resources" value="D:\DataBackup\DataBackup\UnconfirmTransactionService\UnconfirmedTransactions\Resources"/>

While execution reaches at xml.LoadXml(_filePath) exception occur as :

Data at the root level is invalid. Line 1, position 1.

How to resolve this issue?

string SMStext = string.Empty;
try
{
    string _resource = ConfigurationManager.AppSettings["Resources"].ToString();
    string _filePath = _resource + @"\SmsTemplates.xml";
    XmlDocument xml = new XmlDocument();
    xml.LoadXml(_filePath);
}

Tried to change the path. Checked file is available or not in path.

burnsi
  • 6,194
  • 13
  • 17
  • 27

0 Answers0