/Data/myFiles/
I want to open the data path above, which is local to my App folder (HoloApp/Data/myFiles), in my Hololens app. From what I understand the chief way of doing this is with FileOpenPickers. I've perused the API's and attempted to get even the most basic, stripped down, simple FOP I can make working.
FileOpenPicker openPicker = new FileOpenPicker();
openPicker.ViewMode = PickerViewMode.Thumbnail;
Task task = new Task(
async () =>
{
StorageFile file = await openPicker.PickSingleFileAsync();
if (file != null)
{
// Application now has read/write access to the picked file
Debug.Log("Picked file: " + file.Name);
}
else
{
Debug.Log("Cancelled");
}
});
task.Start();
task.Wait();
I've been struggling with this for a week+ with not a lick of luck (my apologies for being horrid at UWP app dev.) Any advice, links, encouragement is immensely appreciated
Here is the latest return:
Exception thrown: 'System.Exception' in mscorlib.ni.dll
The program '[4084] hololensapplication.exe' has exited with code -1073741189 (0xc000027b).
The Microsoft Dev Center isn't much help with this error code either.
EDIT:
private async void OpenPdfButton_Click()
{
FileOpenPicker openPicker = new FileOpenPicker();
openPicker.FileTypeFilter.Add(".pdf");
StorageFile file = await openPicker.PickSingleFileAsync();
}
Crashes with
Exception thrown: 'System.Exception' in mscorlib.ni.dll
The program '[4268] hololensapplication.exe' has exited with code -1073741189 (0xc000027b).