Why can't I read XML from AppData in WinRT?

What I want
get a xml file from the AppData.Local, and serialize it to a listWhat I code
The Error Part:\[code\]List<myTask> AllTaskList = await objectStorageHelper.LoadAsync();\[/code\]myTask is a simple class:\[code\]public class myTask{ public string myTitle { get; set; } public string myDuetime { get; set; }}\[/code\]objectStorageHelper is a HelpClass from CodePlex, the LoadAsync part is below:\[code\] public async Task<T> LoadAsync() { try { StorageFile file = null; StorageFolder folder = GetFolder(storageType); file = await folder.GetFileAsync(FileName()); //file = await folder.CreateFileAsync("BetterTask.xml", CreationCollisionOption.OpenIfExists); IRandomAccessStream readStream = await file.OpenAsync(FileAccessMode.Read); Stream inStream = Task.Run(() => readStream.AsStreamForRead()).Result; return (T)serializer.Deserialize(inStream); } catch (FileNotFoundException) { //file not existing is perfectly valid so simply return the default return default(T); //Interesting thread here: How to detect if a file exists (http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/1eb71a80-c59c-4146-aeb6-fefd69f4b4bb) //throw; } catch (Exception) { //Unable to load contents of file throw; } }\[/code\]What is the Error\[quote\] An exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll but was not handled in user code Additional information: Access Denied
 
Back
Top