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.

WinUI in Desktop app is silently crashed if I put Grid descendant to the Grid.Children collection

See original GitHub issue

Hello!

I created a "Blank App, Packaged (WinUI in Desktop) from VS templates.

In MainPage.xaml I set a name for the root grid.

<Grid x:Name="RootGrid"> </Grid>

Next, in MainPage.xaml.cs, I created a Grid descendant and put it to the Children collection of the RootGrid.

public sealed partial class MainWindow : Window { public MainWindow() { this.InitializeComponent(); RootGrid.Children.Add(new MyGrid() { Background = new SolidColorBrush(Colors.Red) }); } } public class MyGrid : Grid { }

The main window shows for a seconds and application exits without any errors or exceptions.

Version Info

NuGet package version: Microsoft.WinUI 3.0.0-preview2.200713.0 Windows 10 version: 1903 (OS Build 18362.1082)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
stevenbrixcommented, Nov 16, 2020

@PureWeen and @BorzillaR, I just validated that the attached repro app no longer has an issue with preview3

1reaction
stevenbrixcommented, Nov 17, 2020

@BorzillaR - I’m closing this out now that preview3 has been released. Please respond if you are still experiencing this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

App Crash with GridSplitter Control in combination with a ...
WinUI 3 application throws an exception when you move the GridSplitter Control. This happens if you use a GridSplitter in combination with a ......
Read more >
WinUI 3 App Runs on Development Machine, Crashes ...
I have a WinUI3/Windows App executable which runs fine on my development machine. After it's signed it can be installed on the development ......
Read more >
Grid Class (Windows.UI.Xaml.Controls) - UWP
Defines a flexible grid area that consists of columns and rows. Child elements of the Grid are measured and arranged according to their...
Read more >
App crashes when exiting an app that uses MenuBar and ...
In an app that uses MenuBar and WebView2, if you exit the app after performing the following processing, an access violation will occur....
Read more >
Can't change the UseLightweightTemplates property after ...
This error is crashing my application and I feel that it shouldn't really, it could be handled silently and not close the app...
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