Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Xml text reader can't find xml file

$
0
0

I'm trying to read a custom xml file which I'll then be loading the data into a ListView for a user to select.

I've created the xml file, and placed it in the resources folder in another folder called xml.

I use the following code to read an xml file on a windows application I've created before without any issues:

 XmlTextReader reader = new XmlTextReader("XMLFile1.xml");

while (reader.Read())
{
... //element reading bits here

Whenever I run this on android I get an error that it can't find the xml file. I've tried changing the string to the location including "resource/xml" etc. but it still can't find it.
The xml file is listed to build as an android resource.

What string do I need to put in the call to xmltextreader in order for it to find my xml file? I'm convinced this is something stupid, and it's driving me mental!


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>