Hi, 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? Thanks
Hi, 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? Thanks
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);