microsoft / microsoft/microsoft-ui-xaml

Crash in `Microsoft.VisualStudio.DesignTools.WinUITap.dll`

Open
#9,884 3 comments 1 reaction 0 assignees View on GitHub
area-ProjectSystem bug team-Core team-Markup
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

### Describe the bug

I thought it was due to live visual tree, but it still happens after closing it.

### Steps to reproduce the bug

1. Create a new C++ Winui3 packaged project
2. In the button click handler, use this code
```cpp
void MainWindow::myButton_Click(IInspectable const&, RoutedEventArgs const&)
{
winrt::Microsoft::UI::Xaml::Window window;
}
```
3. Build and run with debugging in visual studio, click the button, app crash.

### Expected behavior

_No response_

### Screenshots

![image](https://github.com/user-attachments/assets/b271f091-f868-4197-9449-1b417a4fc62d)

### NuGet package version

WinUI 3 - Windows App SDK 1.5.5: 1.5.240627000

### Windows version

Windows 11 (22H2): Build 22621

### Additional context
[Repro](https://github.com/HO-COOH/WinUI-Bug/tree/main/14-XamlVisualTreeCrash)

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the linked 14-XamlVisualTreeCrash repro, build the C++ WinUI 3 packaged project, and run it under the debugger. Trigger MainWindow::myButton_Click with the Microsoft.UI.Xaml.Window declaration and inspect the resulting crash in Microsoft.VisualStudio.DesignTools.WinUITap.dll. Done means the reproduced button click no longer crashes the app.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.