I am trying to load an xml file that is stored as a resource in my C# project so I can perform various LINQ queries. However at runtime an "Illegal characters in path" exception is thrown. This is how I am loading the file:
XDocument doc = XDocument.Load(MyProject.Properties.Resources.XMLFile);
Wouldn't XMLFile
here actually return the xml itself? If so:
XDocument doc = XDocument.Parse(MyProject.Properties.Resources.XMLFile);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With