I have an embedded XML as Resource. When trying to load it like:
XDocument quoteDocument = XDocument.Load(Properties.Resources.Quotes);
I get an error:
UriFormatException
How to properly load an XML from resources?
Use the following for XDocument
XDocument quoteDocument = XDocument.Parse(Properties.Resources.Quotes);
While this code works for XmlDocument
XmlDocument quoteDocument = new XmlDocument();
quoteDocument.LoadXml(Properties.Resources.Quotes);
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