I was recently working on a project that required using Xml so I naturally used LINQ-to-XML to load my documents.
Unfortunately, as soon as I used the XDocument.Load method, I encountered this dreaded error message:
Data at the root level is invalid. Line 1, position 1.
This error is thrown only in prod environment but not in local
doc = XDocument.Load("C:\\Documents\\analyse\\InterBatch.ini");
XElement rootNode = doc.Element(Constant.NODE_CONFIGURATION);
fichierInstall.Base = this.ReadNodeBase(rootNode, Constant.NODE_BASE);
fichierInstall.Log = this.ReadNodeLog(rootNode, Constant.NODE_LOG);
fichierInstall.PathEntree = this.ReadNodePathEntree(rootNode, Constant.NODE_PATH_ENTREE);
fichierInstall.PathSortie = this.ReadNodePathSortie(rootNode, Constant.NODE_PATH_SORTIE);
any idea about the issue?
thank you