I am building a Windows Phone 8.1 RT App which runs MP3 files in Background task.
I followed the steps in the sample code shown here : http://code.msdn.microsoft.com/windowsapps/BackgroundAudio-63bbc319
In MyPlaylistManager Project I would like to build my own Playlist from XML file.
When I try to access this XML file I am getting an exception.
An exception of type 'System.Xml.XmlException' occurred in SYSTEM.XML.NI.DLL but was not handled in user code
Additional information: An internal error has occurred.
I have added the XML file to the Project and set
Build Action : Content
Copy to Output Directory : Copy if newer
To access the file I tired below options :
XDocument xdoc = XDocument.Load("ms-appx:///XYZ.xml");
XDocument xdoc = XDocument.Load("XYZ.xml");
XDocument.Load is supported in Windows Phone 8.1 as per the documentation: http://msdn.microsoft.com/en-us/library/bb343181(v=vs.110).aspx
Any pointers on what I am doing wrong. Thanks.
StorageFile file = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync("XYZ.xml");
? – Romasz