What I want:
get a xml from the AppData to use
What I code
StorageFolder localFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
StorageFile sampleFile = localFolder.GetFileAsync("abc.xml");
What I get
Error: Cannot implicitly convert type ‘Windows.Foundation.IAsyncOperation’ to ‘Windows.Storage.StorageFile’
What I Check
When this method completes successfully, it returns a StorageFile that
represents the file.
What I have
Windows 8 Release Preview 64bit;
Visual Studio Express 2012 RC for Windows 8;
C#
I write the code according to the MSDN doc, Why does this error happen and how to resolve it?
Try using “
StorageFile sampleFile = await localFolder.GetFileAsync("abc.xml")” if you’re in C# or “localFolder.GetFileAsnc("abc.xml").done(function (sampleFile) {})” if you’re using JS.