You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a WIN UI 3 app is configured to start with elevated privileges by adding the allowElevation capability and setting the requestedExecutionLevel to requireAdministrator; invoking FileOpenPicker.PickSingleFileAsync() causes the application to crash (note: this is irrespective of IDE as it also crashes when I run outside of Visual Studio). On further investigation wrapping FileOpenPicker.PickSingleFileAsync() and logging the exception to a file gives the following error:
Error HRESULT E_FAIL has been returned from a call to a COM component.
System.Runtime.InteropServices.COMException (0x80004005): Error HRESULT E_FAIL has been returned from a call to a COM component.
Ensure your application has a button that triggers a FileOpenDialog. See sample below:
FileOpenPicker open = new FileOpenPicker();
InitializeWithWindow.Initialize(open, MainWindowPtr); //MainWindowPtr is the pointer to the main window of the app (i.e. parent of the current page that extends Window). This line attaches the dialog to the window of your app.
open.SuggestedStartLocation = PickerLocationId.ComputerFolder;
open.FileTypeFilter.Add(".exe");
StorageFile file = await open.PickSingleFileAsync();
Note that the app crashes/throws a COM exception
Expected behavior
It should pop up the select file/folder dialog even when the app is started with administrator privileges
Screenshots
No response
NuGet package version
1.1.2
Packaging type
Packaged (MSIX)
Windows version
Insider Build (xxxxx)
IDE
Visual Studio 2022
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
When a WIN UI 3 app is configured to start with elevated privileges by adding the
allowElevation
capability and setting therequestedExecutionLevel
torequireAdministrator
; invokingFileOpenPicker.PickSingleFileAsync()
causes the application to crash (note: this is irrespective of IDE as it also crashes when I run outside of Visual Studio). On further investigation wrappingFileOpenPicker.PickSingleFileAsync()
and logging the exception to a file gives the following error:Checking the Event viewer logs shows:
Steps to reproduce the bug
Go to your application's Package.appxmanifest and add the capabilities:
Go to the application's app.manifest and modify as follows:
Ensure your application has a button that triggers a FileOpenDialog. See sample below:
Note that the app crashes/throws a COM exception
Expected behavior
It should pop up the select file/folder dialog even when the app is started with administrator privileges
Screenshots
No response
NuGet package version
1.1.2
Packaging type
Packaged (MSIX)
Windows version
Insider Build (xxxxx)
IDE
Visual Studio 2022
Additional context
No response
The text was updated successfully, but these errors were encountered: