Describe the bug
During migration of a UWP application to Windows App SDK it was noticed that File Pickers are not functional when using an AppContainer style app instead of a Full Trust application when packaged.
It is not clear which component in the dependency chain is actually responsible, opening the bug here on the premise of UI not being at fault since its a system dialog an not WinUI dialog. The exception happens in the WinRT Interop call and not user code.
This behavior is present since Project Reunion releases from 2 years ago, see the second linked post in the additional contents and does not seem like a recent regression.
Steps to reproduce the bug
- Create a sample application project
- Add File Open/Save picker following the Documentation for WinUI3/Win App SDK on Interop
- Run the application and verify it works
- Go into Package Manifest and change Entrypoint to => Windows.PartialTrustApplication and remove the runFullTrust restricted capability.
- Build and Run the application again
- Application will crash on trying to open the picker with Win32 Exception E_ACCESSDENIED in the call for InitializeWithAppWindow.Initialize()
Expected behavior
Application is able to open File Picker in partial trust mode.
This is base functionality that is possible in UWP which blocks the migration path of applications that perform any file I/O requiring user choice. In some cases running full trust is not allowed only by exemption from the rule, see Microsoft Store submission guidelines.
Screenshots
No response
NuGet package version
Windows App SDK 1.2.5: 1.2.230313.1
Packaging type
Packaged (MSIX)
Windows version
Windows 11 version 22H2 (22621, 2022 Update)
IDE
Visual Studio 2022
Additional context
See links below:
Similar report in discussions: #3447
Post from 2021 with the issue on Project Reunion
Describe the bug
During migration of a UWP application to Windows App SDK it was noticed that File Pickers are not functional when using an AppContainer style app instead of a Full Trust application when packaged.
It is not clear which component in the dependency chain is actually responsible, opening the bug here on the premise of UI not being at fault since its a system dialog an not WinUI dialog. The exception happens in the WinRT Interop call and not user code.
This behavior is present since Project Reunion releases from 2 years ago, see the second linked post in the additional contents and does not seem like a recent regression.
Steps to reproduce the bug
Expected behavior
Application is able to open File Picker in partial trust mode.
This is base functionality that is possible in UWP which blocks the migration path of applications that perform any file I/O requiring user choice. In some cases running full trust is not allowed only by exemption from the rule, see Microsoft Store submission guidelines.
Screenshots
No response
NuGet package version
Windows App SDK 1.2.5: 1.2.230313.1
Packaging type
Packaged (MSIX)
Windows version
Windows 11 version 22H2 (22621, 2022 Update)
IDE
Visual Studio 2022
Additional context
See links below:
Similar report in discussions: #3447
Post from 2021 with the issue on Project Reunion