Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] [Windows] File Picker Crashes After File Not Found #16068

Closed
dylandrush opened this issue Jul 10, 2023 · 4 comments
Closed

[Bug] [Windows] File Picker Crashes After File Not Found #16068

dylandrush opened this issue Jul 10, 2023 · 4 comments
Labels
area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info platform/windows 🪟 s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@dylandrush
Copy link

dylandrush commented Jul 10, 2023

Description

When using the file picker:

    private async void OnCounterClicked(object sender, EventArgs e)
    {
        var result = await FilePicker.PickAsync();
    }

If you try to put in an invalid file, you get a File Not Found warning dialog, but now the file picker is in a broken state. Clicking on the cancel will cause it to crash, as will trying to select a valid file. Unlike in other file pickers, at this point the file name will not get over written regardless of what file you try to select.

I get the following output:

Exception thrown: 'System.Runtime.InteropServices.COMException' in System.Private.CoreLib.dll
Exception thrown: 'System.Runtime.InteropServices.COMException' in System.Private.CoreLib.dll
Exception thrown: 'System.Runtime.InteropServices.COMException' in System.Private.CoreLib.dll
The program '[6764] MauiFilePickerSample.exe' has exited with code 3221226107 (0xc000027b).

Surrounding the FilePicker.PickAsync(); with a try/catch causes the program to get into a locked state with the file picker UI closing but still seeming like it has focus as you can't interact with the main UI anymore.

Linking to basic repo I found that has both multi and single file pickers. Thought the problem might be specific to something I was doing, but same behavior in demo repo I found:

https://github.com/jfversluis/MauiFilePickerSample

Steps to Reproduce

  1. Open the file picker
  2. In the "File name:" field, type in any non existent file
  3. Click on the "Open" button
  4. Click on the "OK" button in the warning dialog
  5. Click on the "Cancel" button in the file picker
  6. ???
  7. Get the following:
Exception thrown: 'System.Runtime.InteropServices.COMException' in System.Private.CoreLib.dll
Exception thrown: 'System.Runtime.InteropServices.COMException' in System.Private.CoreLib.dll
Exception thrown: 'System.Runtime.InteropServices.COMException' in System.Private.CoreLib.dll
The program '[2488] MauiFilePickerSample.exe' has exited with code 3221226107 (0xc000027b).

Link to public reproduction project repository

https://github.com/jfversluis/MauiFilePickerSample

Version with bug

7.0.49

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

Windows SDK 10.0.17763.0

Did you find any workaround?

No response

Relevant log output

No response

@dylandrush dylandrush added the t/bug Something isn't working label Jul 10, 2023
@Eilon Eilon added the area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info label Jul 10, 2023
@mattleibow mattleibow added this to the Backlog milestone Jul 11, 2023
@ghost
Copy link

ghost commented Jul 11, 2023

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

@AnnYang01
Copy link

Verified this on Visual Studio Enterprise 17.7.0 Preview 6.0 in Windows 11. This issue didn't repro on .NET 8.0 with below Project:
MauiApp8.zip
Screen recording:
Crash

@AnnYang01 AnnYang01 added s/verified Verified / Reproducible Issue ready for Engineering Triage s/try-latest-version Please try to reproduce the potential issue on the latest public version labels Aug 3, 2023
@ghost
Copy link

ghost commented Aug 3, 2023

Hi @dylandrush. We have added the "s/try-latest-version" label to this issue, which indicates that we'd like you to try and reproduce this issue on the latest available public version. This can happen because we think that this issue was fixed in a version that has just been released, or the information provided by you indicates that you might be working with an older version.

You can install the latest version by installing the latest Visual Studio (Preview) with the .NET MAUI workload installed. If the issue still persists, please let us know with any additional details and ideally a reproduction project provided through a GitHub repository.

This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.

@dylandrush
Copy link
Author

Does seem to be working now on Windows 10, Microsoft Visual Studio Community 2022 (64-bit) - Preview Version 17.7.0 Preview 6.0

@ghost ghost removed the s/try-latest-version Please try to reproduce the potential issue on the latest public version label Aug 7, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Sep 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info platform/windows 🪟 s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants