1
votes

I am getting error on following line

StorageFolder picturesFolder = KnownFolders.PicturesLibrary;

Exception is: ex {System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) at Windows.Storage.KnownFolders.get_PicturesLibrary() at WinTooth.MainPage.d__0.MoveNext()} System.SystemException {System.UnauthorizedAccessException}

I have also added lines to register for a file association extension. Please suggest/help.

2

2 Answers

1
votes

http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.knownfolders.pictureslibrary says Windows Phone 8: This API is not intended to be used directly from your code.

In my app I used

             var photoChooserTask = new PhotoChooserTask();
             photoChooserTask.Completed += OnPhotoChooserTask_Completed;
             photoChooserTask.Show();

to pick a photo.

1
votes

I was having same problem but my issue was that i was reading too much files using iBuffer so it was taking too much memory and it was causing out of memory issue. So i optimized it and this issue was fixed.