microsoft / microsoft/microsoft-ui-xaml

WinUI 3 - Kiosk : Error - "The application called an interface that was marshalled for a different thread"

Open
#10,304 2 comments 0 reactions 0 assignees View on GitHub
bug needs-triage
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

### Describe the bug

Hi There,

I have simple WinUI3 applications and I wanted to use this this WinUI 3 app into Kiosk Mode, When I deploy/packaged I can not see the app listed in Kiosk mode, If I change configuration for EntryPoint as "ApplicationName" in "Package.appxmanifest" file, I am able to see this app listed into Kiosk mode. However when I try to run it it throws ''The application called an interface that was marshalled for a different thread. The Application Object must initially be accessed from the multi-thread apartment."error.

I need this WinUI 3 application to be run successfully with Kiosk Mode.

### Steps to reproduce the bug

1.Download https://github.com/PawarSa1999/WinUI3KioskTest
2.Open Visual Studio 2022 and Run the project
3.Debug - x64

it will throw error as EntryPoint has been change as 'ApplicationName' into "Package.appxmanifest". If we keep as default ('"$targetentrypoint$" ') it will run the app but it won't be visible in Kiosk application list.

### Expected behavior

WinUI 3 application need to run successfully with Kiosk Mode.

### Screenshots

![Image](https://github.com/user-attachments/assets/8a3fe8e8-191e-4745-9d0c-36f84ec96ba9)

![Image](https://github.com/user-attachments/assets/4b29bb69-5eab-4f8f-982e-f6c77eb1d4a2)

![Image](https://github.com/user-attachments/assets/dbc063bb-89dd-48c8-86b1-11c70e3f45f5)

### NuGet package version

WinUI 3 - Windows App SDK 1.6.3: 1.6.241114003

### Windows version

Windows 11 (23H2): Build 22631

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the linked WinUI3KioskTest project and its Package.appxmanifest; reproduce the issue in Visual Studio 2022 using Debug x64 and the stated Windows App SDK version. Compare the default "$targetentrypoint$" with "ApplicationName" and trace the reported threading error. Done means the packaged app appears in Kiosk mode and launches without the marshalled-interface error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.