locked
folderPicker.pickSingleFolderAsync crashes

    Question

  • OK I got it working and resolved the crash, however I wanted to understand the rationale.

    I had a simple straightforward function for filePicker and that would crash the app, and without any valid error messages either. While I was completely confused with the behavior was even more surprised that to fix the problem I needed to add 

    var folderPicker = new Windows.Storage.Pickers.FolderPicker;
    folderPicker.suggestedStartLocation = Windows.Storage.Pickers.PickerLocationId.picturesLibrary;
    folderPicker.fileTypeFilter.push("*"); // work around to fix the crash
    folderPicker.pickSingleFolderAsync().then(function (folder) { 
        // then...
    });
    

    there is no indication in the documentation for this added step, nor does it make any design sense to be included (unless there really is some internal reason - which should be detailed in the documentation).

    I hope this req changes, or at the least the documentation is updated with the details.


    Regards, Rv.

    Wednesday, October 29, 2014 8:01 PM

All replies

  • Thanks for the feedback Ravi. I will open a doc bug to clarify that the additional step of adding the filter type is necessary.

    Actually when the exception is thrown (after commenting the ...push("*") line above, the thrown exception does include the message stating: "WinRT information: The FileTypeFilters property must have at least one file type filter specified."


    Windows Store Developer Solutions, follow us on Twitter: @WSDevSol|| Want more solutions? See our blog

    Thursday, October 30, 2014 12:23 AM
    Moderator
  • I am developing with typescript, and mostly have my debugging set to script (since the other mode "Native with Script" is unreliable) and in this mode, it doesn't push any error info.

    All that I got was "unknown error message" or something similar.


    Regards, Rv.

    Thursday, October 30, 2014 1:45 AM