Skip to content

FileOpenPicker, FolderPicker and FolderPicker not available in partial trust/AppContainer #9557

@sungaila

Description

@sungaila

Describe the bug

In WinUI 3 it is needed to do the following call to initialize a picker dialog:

WinRT.Interop.InitializeWithWindow.Initialize(openPicker, hWnd);

It works just fine in full trust mode but fails when it is called in partial trust/inside an AppContainer (access denied exception).

This is terrible news because it means that WinUI 3 can either use the WinRT file dialogs OR run in partial trust. But NOT both at the same time.

Steps to reproduce the bug

  1. Create a packaged WinUI 3 app with the default template
  2. Change Package.appxmanifest such that the app runs in partial mode
  3. Optional: add the broadFileSystemAccess capability
  4. Test the FilePicker code snippet from the WinUI 3 Gallery: winui3gallery://item/FilePicker

Expected behavior

The file dialogs should open just as expected.

Screenshots

No response

NuGet package version

WinUI 3 - Windows App SDK 1.5.2: 1.5.240404000

Windows version

Windows 11 (22H2): Build 22621

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingteam-ReachIssue for the Reach team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions