Gautam Gautam - 11 months ago 51 Question

What is the best way to read an XML file from Embedded resources?

Dim xmldoc As New XmlDocument()
Dim xmlnode As XmlNodeList
Dim i As Integer
Dim str As String


This throws

An exception of type 'System.Xml.XmlException' occurred in System.Xml.dll but was not handled in user code. Additional information: Data at the root level is invalid. Line 1, position 1.

Answer Source

I would normally do this

Dim fsXML As New FileStream("countyByRegion.xml", FileMode.Open, FileAccess.Read)

And then use xmldoc.Load(fsXML)