[Bug] FilePicker throw an exception on WinUI3
See original GitHub issueDescription
FilePicker throw exception System.Runtime.InteropServices.COMException:“Invalid window handle. (0x80070578)” on WinUI3
Steps to Reproduce
- Create a
maui-blazor
project - Call
FilePicker.PickAsync
by the following code
private async void Button_Clicked(object sender, EventArgs e)
{
var result = await FilePicker.PickAsync();
}
- Press F5 to run *.WinUI3(Package) project
- 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:
- Created 2 years ago
- Comments:5
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I understand, thanks
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