dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.27k stars 1.76k forks source link

App crash after invoked FilePicker.Default.PickAsync in administrator mode and release mode of the Unpackaged app #24141

Open jingliancui opened 3 months ago

jingliancui commented 3 months ago

Description

The case specially crashes in

  1. Release Version
  2. Administrator mode
  3. Unpackaged App

Steps to Reproduce

  1. Open the .sln file by using VS2022
  2. Publish the app by using this command dotnet publish -f net8.0-windows10.0.19041.0 -p:RuntimeIdentifierOverride=win10-x64 -p:WindowsPackageType=None -p:WindowsAppSDKSelfContained=true
  3. Open the app using administrator mode
  4. Click the button "Chose File"

Actual Result: App crash

Except Result: App does not crash

Link to public reproduction project repository

https://github.com/jingliancui/MAUIWinFilePickerIssue

Version with bug

8.0.80 SR8

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

10.0.19041.0

Did you find any workaround?

No

Relevant log output

No
github-actions[bot] commented 3 months ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

ninachen03 commented 3 months ago

I can repro this issue at windows platform on the latest 17.11.0 Preview 7.0 (8.0.80 & 8.0.71).

uwer62 commented 3 months ago

Welcome to the club :-( One has to dig two times deep. WinUI3: https://github.com/microsoft/microsoft-ui-xaml/issues/9476 (closed) points to: WindowsAppSDK: https://github.com/microsoft/WindowsAppSDK/issues/2504

This bug is open for 2 years now without a solution. We have chosen to to use the CommonOpenFileDialog from the WindowsAPICodePack.Shell.CommonFileDialogs NuGet package. It throws some warnings during build but it works. It's really a shame that this doesn't get fixed