I'm writing a little application on WinRT Metro Apps. I need to read an xml file and i get a awful COMException :/
This is which should read this xml:
Windows.Storage.StorageFolder storageFolder = await
Windows.ApplicationModel.Package.Current.InstalledLocation
.GetFolderAsync("Common");
Windows.Storage.StorageFile storageFile = await
storageFolder.GetFileAsync("testFile.xml");
var stream = await storageFile.OpenAsync(Windows.Storage.FileAccessMode.Read);
XmlDocument doc = await XmlDocument.LoadFromAsync(storageFile);
Can somebody give me somes tips to make it work?
Why do you use OpenAsync()
? (Further more, doesn't the method named LoadFromAsync
exist?)
Please see this Web page: How to read and write data into XML file In Metro style apps ?
By the way, error 0xC00CE508
occurs in many cases, while parsing XML
. Please check that the contents of the XML
have no error, by using the XmlDocument.LoadXml(String)
method.
User contributions licensed under CC BY-SA 3.0