I'm having trouble with reading a file from embedded resources.
I'm starting to learn about developing applications for eBay. You can pass queries to eBay in XML format, and receive replies back in the same format.
I have some examples of code to do this. Here's how the sample code loads an xml file, containing the query.
This works in the sample code. But when I try to write my own code, using those exact lines, it doesn't work. The line xml_stream = curr... fails. xml_stream is nothing. And that means that xmlDoc. Load fails.Code:'Get XML Document from Embedded Resources Dim xmlDoc As New XmlDocument() Dim current_assembly As Assembly Dim xml_stream As Stream current_assembly = Assembly.GetExecutingAssembly() xml_stream = current_assembly.GetManifestResourceStream("Sample.xml_file.xml") xmlDoc.Load(xml_stream)
I can't see any difference between the sample and my attempt.
The Assembly Name and Root Namespace in my project are both set to "Sample," just as in the original.
I've tried things like changing the filename and the namespace, but I still can't get it to work.




Reply With Quote