question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Huge bug, mouse right click on any numberbox or textbox crashes new WinUI3 project instantly

See original GitHub issue

Describe the bug

Greetings, i think i’ve found a very huge bug in WinUI3.

Just create any new packaged project be it WAP or not.

As soon as you add a textbox and mouse right click on it semms at first that the textbox is trying to create a context menu but it only displays a very tiny portion of it and dissapears instantly, however, as soon as you write anything on the textbox and try the context menu again the application imediately crashes with the following error:

Exception thrown at 0x767EB502 in App2.exe: Microsoft C++ exception: winrt::hresult_error at memory location 0x027EDD08.

Is this bug already known? if so, what is the workaround?

XAML page code with no special code behind in C# `<Window x:Class="App3.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:App3" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">

<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">


        <TextBlock Text="Nationality" Width="90" Margin="5 5 5 5"  HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Right"/>
        <TextBox Width="200" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0"/>

</StackPanel>

</Window>`

My Environment: VS2022 Community (non preview release) WinUI3 1.0 Preview 3 (latest at the date of this post) WinUI 3 Blank App Packaged (WAP and non WAP) Windows 10 21h1 x64

Steps to reproduce the bug

  1. Create new WinUI3 Blank app Project
  2. Add a textbox
  3. Right mouse click on it
  4. A very tiny context menu appears but dissapears
  5. Write a text on the textbox
  6. Right mouse click on it again
  7. Application crashes.

Expected behavior

Should simply open the textbox default context menu normaly.

Screenshots

No response

NuGet package version

No response

Windows app type

  • UWP
  • Win32

Device form factor

Desktop

Windows version

May 2021 Update (19043)

Additional context

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:8

github_iconTop GitHub Comments

1reaction
github-actions[bot]commented, Jul 29, 2023

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 5 days.

1reaction
DominicMaascommented, Nov 17, 2021

Can reproduce this. Windows 11, VS2022, Blank packaged WinUI3 1.0.0 app with the above specified XAML.

Exception thrown at 0x7567EB02 (KernelBase.dll) in WinUiTest.exe: WinRT originate error - 0x80070490 : 'Element not found.'.
onecore\com\combase\winrt\error\restrictederror.cpp(1017)\combase.dll!75A83529: (caller: 759928E2) ReturnHr(9) tid(e640) 8007007E The specified module could not be found.
Exception thrown at 0x7567EB02 in WinUiTest.exe: Microsoft C++ exception: winrt::hresult_error at memory location 0x0301D808.

Seems to work when running the application from outside Visual Studio (e.g. Start Menu)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Learn WinUI 3.0
A beginner's guide to building Windows applications with WinUI for UWP and desktop applications.
Read more >
WinUI 3 | XAML Brewer, by Diederik Krols | Page 2
Posts about WinUI 3 written by xamlbrewer. ... When diamonds are found, a NumberBox is filled for the quantity and a button pressed....
Read more >
Reflection IT Blog
I'm in the process of learning the new Windows SDK Preview. This SDK has made it possible to set the Kind property of...
Read more >
WinUI 3 Preview 4 is available
WebView2: Double right click on mouse causes a crash. Clicking on a ToggleSplitButton causes the application to crash. WinUI 3 Desktop: Empty ...
Read more >
Untitled
Xaml right click c# - Adding a right click menu to an item - Stack ... Huge bug, mouse right click on any...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found