locked
Windows 8.1 FileOpenPicker

    Question

  • I made the app for windows store. It worked fine until I upgraded my os to Windows 8.1. There is an error while I'm trying to FileOpenPicker: Element not found. (Исключение из HRESULT: 0x80070490).

    Here is stacktrace:

    at Windows.Storage.Pickers.FileOpenPicker.PickSingleFileAsync()
    at Crypto.Engine.d__13.MoveNext()

    and code:

        FileOpenPicker fop = new FileOpenPicker();
        fop.FileTypeFilter.Add(*);
        fop.SuggestedStartLocation = PickerLocationId.DocumentsLibrary;
        try
        {
            StorageFile file = await fop.PickSingleFileAsync();
            return file;
        }
            catch(Exception ex) {}

    How can I fix it?

    • Moved by Caillen Monday, September 22, 2014 5:33 AM
    Sunday, September 21, 2014 4:19 PM

Answers

  • Could be, but I'm not sure, let's see from its description: When you use Windows Update or Microsoft Update to install updates, you may receive error 0x80070490, if the Component-Based Servicing (CBS) manifest is corrupted.

    FileOpenPicker is not a Update or aim to install any update.

    However I think you may need to fix your system because I cannot reproduce this issue. You can test the same code in another machine to see if it works fine. At least it works prefect with my machine.

    For a suggestion, you could test with system level fileopenpicker, for instance the picture app, try to select some images from your system, if you have the same problem, that means your OS is corrupted, try to repair it. If not, probably the problem is on your Visual Studio, try to fix it from Control Panel.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Wednesday, September 24, 2014 5:03 AM
    Moderator

All replies

  • Hi Daria,

    Building Windows Store apps with C# or VB forum is the most suitable place for your question. I'm moving it here.

    Thanks for your understanding.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, September 22, 2014 5:35 AM
  • Hi Daria,

    Where you put these code? Let's say if you execute the code with a button click event.

    If you can make it works well, probably you put the code in a wrong place, for instance your screen does not have enough place to display the FileOpenPicker or running the code in a Task.

    If you fail with a button click event, then it means something wrong with your environment.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, September 22, 2014 6:20 AM
    Moderator
  • Thank you for your answer!

    Yes, I execute this code in button click event. And my display's resolution is 1920*1080.

    How I wrote earlier, my app worked on Windows 8, but didn't on Windows 8.1. Can it be a reason?

    Monday, September 22, 2014 9:03 AM
  • Another thing you have to aware, the line is incorrect from syntax:

    fop.FileTypeFilter.Add("*");
    //fop.FileTypeFilter.Add(*);

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, September 22, 2014 9:14 AM
    Moderator
  • Thank you!

    Right syntax doesn't work to. Can this error be due to this: http://support.microsoft.com/kb/958044/en-us?

    Monday, September 22, 2014 7:10 PM
  • Could be, but I'm not sure, let's see from its description: When you use Windows Update or Microsoft Update to install updates, you may receive error 0x80070490, if the Component-Based Servicing (CBS) manifest is corrupted.

    FileOpenPicker is not a Update or aim to install any update.

    However I think you may need to fix your system because I cannot reproduce this issue. You can test the same code in another machine to see if it works fine. At least it works prefect with my machine.

    For a suggestion, you could test with system level fileopenpicker, for instance the picture app, try to select some images from your system, if you have the same problem, that means your OS is corrupted, try to repair it. If not, probably the problem is on your Visual Studio, try to fix it from Control Panel.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Wednesday, September 24, 2014 5:03 AM
    Moderator
  • I'm sorry for the long answer.

    I tried my project to another machine. And it had the error to.

    Also I create new project in Visual Studio 2013 and FileOpenPicker class is different here as in Visual Studio 2012.

    Visual Studio 2012:

        [Activatable(100794368)]
        [Muse(Version = 100794368)]
        [Version(100794368)]
        public sealed class FileOpenPicker
        {
            public FileOpenPicker();

            public string CommitButtonText { get; set; }
            public IList<string> FileTypeFilter { get; }
            public string SettingsIdentifier { get; set; }
            public PickerLocationId SuggestedStartLocation { get; set; }
            public PickerViewMode ViewMode { get; set; }

            public IAsyncOperation<IReadOnlyList<global::Windows.Storage.StorageFile>> PickMultipleFilesAsync();
            public IAsyncOperation<global::Windows.Storage.StorageFile> PickSingleFileAsync();
        }

    Visual Studio 2013:

        [Activatable(100794368)]
        [Muse(Version = 100794368)]
        [SupportedOn(100794368, Platform.Windows)]
        [SupportedOn(100794368, Platform.WindowsPhone)]
        [Version(100794368)]
        public sealed class FileOpenPicker
        {
            [SupportedOn(100794368, Platform.Windows)]
            [SupportedOn(100794368, Platform.WindowsPhone)]
            public FileOpenPicker();

            [SupportedOn(100794368, Platform.Windows)]
            [SupportedOn(100794368, Platform.WindowsPhone)]
            public string CommitButtonText { get; set; }

            [SupportedOn(100794368, Platform.Windows)]
            [SupportedOn(100794368, Platform.WindowsPhone)]
            public IList<string> FileTypeFilter { get; }

            [SupportedOn(100794368, Platform.Windows)]
            [SupportedOn(100794368, Platform.WindowsPhone)]
            public string SettingsIdentifier { get; set; }

            [SupportedOn(100794368, Platform.Windows)]
            [SupportedOn(100794368, Platform.WindowsPhone)]
            public PickerLocationId SuggestedStartLocation { get; set; }

            [SupportedOn(100794368, Platform.Windows)]
            [SupportedOn(100794368, Platform.WindowsPhone)]
            public PickerViewMode ViewMode { get; set; }

            [SupportedOn(100794368, Platform.Windows)]
            [SupportedOn(100794368, Platform.WindowsPhone)]
            public IAsyncOperation<IReadOnlyList<global::Windows.Storage.StorageFile>> PickMultipleFilesAsync();

            [SupportedOn(100794368, Platform.Windows)]
            [SupportedOn(100794368, Platform.WindowsPhone)]
            public IAsyncOperation<global::Windows.Storage.StorageFile> PickSingleFileAsync();
        }

    Can it be a reason of the error? How can I fix it?

    Wednesday, October 15, 2014 7:46 PM