microsoft / microsoft/microsoft-ui-xaml

Throws COM exception while using WinUI 3 custom controls in WPF/WF application using XAML

Open
#10,066 4 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

Attempted to use the custom WinUI controls in the WPF application, but encountered a COM exception. I have included a sample, a screenshot for your reference.

[WPF_XAML_Islands_WinUI3-master.zip](https://github.com/user-attachments/files/16945506/WPF_XAML_Islands_WinUI3-master.zip)

![Image](https://github.com/user-attachments/assets/aa75bab7-9914-4df6-ae15-517e86736d65)

### Steps to reproduce the bug

1. Download and run the sample.
2. Note: COM Exception thrown

### Expected behavior

It should be run properly.

### Screenshots

_No response_

### NuGet package version

WinUI 3 - Windows App SDK 1.6.1: 1.6.240923002

### Windows version

Windows 11 (21H2): Build 22000

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Download and run the attached WPF_XAML_Islands_WinUI3-master.zip sample using Windows App SDK 1.6.1 on Windows 11, then capture the COM exception and identify which custom WinUI control or XAML step triggers it. Done means the sample runs without the COM exception in the reported WPF/WF scenario.

Written by the indexing model from the issue text.

Assessment

Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.