[Bug] FilePicker throws COMException on Windows
See original GitHub issueDescription
On WinUI projects on the Windows platform, using the PickAsync
and PickMultipleAsync
methods from the FilePicker class in Essentials results in a System.Runtime.InteropServices.COMException
being thrown. The error message returned in the exception is “Invalid window handle. (0x80070578)”.
I’m not sure if the issue lies within MAUI or WinUI itself.
Steps to Reproduce
- Create a new MAUI project and add a button to the main page
- Add a clicked event to the button with the following handler method:
async private void ButtonClicked(object sender, EventArgs args) { FileResult file = await FilePicker.PickAsync(); }
- Run the app on Windows and click the button
Expected Behavior
The file open dialog should appear.
Actual Behavior
An exception is thrown and the application crashes.
Basic Information
- Version with issue: MAUI Preview 7
- Last known good version: Not known
- IDE: Visual Studio 2022 Preview 3.1
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:16 (5 by maintainers)
Top Results From Across the Web
UWP should clarify its exception when Picker's ...
... a problem with my code because it throws System.Runtime.InteropServices.COMException: 'Unspecified error' when opening the dialog.
Read more >System.Runtime.InteropServices.COMException
When I open the FolderPicker to give the application access to the directory, I get an error, and I have no idea why....
Read more >COMException "Class not registered" on 64-bit Windows
While working with 64 bit Operating System we are getting the below error message. 1. "Class not registered (Exception from HRESULT: 0x80040154 ...
Read more >WhatsConfigured service does not start with System.Runtime ...
Why am I seeing a System.Runtime.InteropServices.COMException error in the Windows Event Viewer Application log when the WhatsConfigured service ...
Read more >Handling System.Runtime.InteropServices.COMException
I am trying to get the feature class name from the shapefile. But it throws,. System.Runtime.InteropServices.COMException: 'Unspecified error.
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
Where is this at? Do we have a timeline for when the fix to these will drop?
This is the issue: https://github.com/microsoft/WindowsAppSDK/issues/1063