I tested the code in Android and it worked fine. I have a PCL in Xamarin Forms.
I have this code:
async void OnButtonClicked(object sender, EventArgs e) { await CrossFilePicker.Current.PickFile(); }
On WindowsPhone it throws this exception:
System.Exception was unhandled by user code HResult=-2147024846 Message=The request is not supported. (Exception from HRESULT: 0x80070032) Source=Windows StackTrace: at Windows.Storage.Pickers.FileOpenPicker.PickSingleFileAsync() at Plugin.FilePicker.FilePickerImplementation.<PickFile>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at AppFilePicker.PickerPage.<OnButtonClicked>d__1.MoveNext() InnerException:
Any ideas why this happening? I ticked on some capabilities so i don't think it's permission problems.
Best Regards
I tested the code in Android and it worked fine. I have a PCL in Xamarin Forms.
I have this code:
async void OnButtonClicked(object sender, EventArgs e) { await CrossFilePicker.Current.PickFile(); }
On WindowsPhone it throws this exception:
System.Exception was unhandled by user code HResult=-2147024846 Message=The request is not supported. (Exception from HRESULT: 0x80070032) Source=Windows StackTrace: at Windows.Storage.Pickers.FileOpenPicker.PickSingleFileAsync() at Plugin.FilePicker.FilePickerImplementation.<PickFile>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at AppFilePicker.PickerPage.<OnButtonClicked>d__1.MoveNext() InnerException:
Any ideas why this happening? I ticked on some capabilities so i don't think it's permission problems. Best Regards