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 throws COMException on Windows

See original GitHub issue

Description

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

  1. Create a new MAUI project and add a button to the main page
  2. 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();
    }
    
  3. 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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:16 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
joshfourbadideascommented, Dec 2, 2021

Where is this at? Do we have a timeline for when the fix to these will drop?

0reactions
mattleibowcommented, Nov 22, 2022
Read more comments on GitHub >

github_iconTop 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 >

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