question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] FilePicker throw an exception on WinUI3

See original GitHub issue

Description

FilePicker throw exception System.Runtime.InteropServices.COMException:“Invalid window handle. (0x80070578)” on WinUI3

Steps to Reproduce

  1. Create a maui-blazor project
  2. Call FilePicker.PickAsync by the following code
        private async void Button_Clicked(object sender, EventArgs e)
        {
            var result = await FilePicker.PickAsync();
        }
  1. Press F5 to run *.WinUI3(Package) project
  2. Click the button to call method Button_Clicked

Expected Behavior

Actual Behavior

Basic Information

  • Version with issue: 6.0.100-preview.4.*
  • Last known good version:
  • IDE: 16.11.0 Preview1.0
  • Platform Target Frameworks:
    • iOS:
    • Android:
    • UWP:
  • Android Support Library Version:
  • Nuget Packages:
  • Affected Devices:

Screenshots

Reproduction Link

Workaround

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
realZhangChicommented, May 30, 2021

I understand, thanks

0reactions
aokocaxcommented, Jan 2, 2022

For windows environment I was able to run it this way. It works flawlessly with both MAUI and MAUI-Blazor.

https://github.com/dotnet/maui/issues/2194#issuecomment-1003773033

Read more comments on GitHub >

github_iconTop Results From Across the Web

WinUI3: Exception thrown while trying to create a FilePicker
My first guess is that, window is null here, var window = WindowHelper.GetWindowForElement(this);. and that can be because you didn't use ...
Read more >
File picker multi select failed with selection of a lot of files.
Hi, When i select 1000 files with multi select the app crash with this exception: The maximum number of items for the access...
Read more >
FileSavePicker Class (Windows.Storage.Pickers)
Represents a file picker that lets the user choose the file name, extension, ... call the PickSaveFileAsync method, or the picker will thrown...
Read more >
Windows.Storage.Pickers
The following table shows which file picker experiences are available across Uno Platform targets. For detailed information see the next sections.
Read more >
Using Asynchronous Windows APIs · React Native for ...
Here we check if the action failed (i.e. status == AsyncStatus::Error ) and if so, we build a ReactError object where the message...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found