Running unpackaged Windows app as admin prevents FilePicker from working #20830
Labels
area-essentials
Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info
platform/windows 🪟
t/bug
Something isn't working
Milestone
Description
Not sure why, but FilePicker throws an exception when trying to use it in an application running as admin. Unsure what else could be broken. Should test suite be re-run as admin as well as standard user?
Exception message is an empty string and the stacktrace only shows my code. Unsure if this is a result of debugging as admin, or if that is the exception that it threw.
Excpetion itself is of type
System.Runtime.InteropServices.COMException
.Discovery story:
Created an installer with NSIS for distribting dev tool internally. After sending out first builds I was getting reports that tool does not work on first launch. My installer has a "launch now" at the end of the installer and because the installer runs as admin so does the launched process. Closing and re-opening my application works as expected.
Steps to Reproduce
From scratch:
<WindowsPackageType>None</WindowsPackageType>
to csproj, and changelaunchSettings.json
to useProject
forcommandName
)From provided repro:
FilePickerAsAdmin.sln
Browse for file
button. This should present a picker and allows you to pick a file. It does nothing with this file, just displays an alert that you were able to pick a file.Browse for file
button againLink to public reproduction project repository
https://github.com/beeradmoore/maui-issue-FilePickerAsAdmin
Version with bug
8.0.7 SR2
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
Windows 11 23H2
Did you find any workaround?
No
Relevant log output
No response
The text was updated successfully, but these errors were encountered: