CommunityToolkit / Windows

Collection of controls for WinUI 2, WinUI 3, and Uno Platform developers. Simplifies and demonstrates common developer tasks building experiences for Windows with .NET.
https://aka.ms/windowstoolkitdocs
Other
538 stars 70 forks source link

Shadows overview sample in gallery crashes under Windows App SDK #512

Open Arlodotexe opened 3 weeks ago

Arlodotexe commented 3 weeks ago

Describe the bug

When running the gallery with the Wasdk head on the latest main commit, the 'Shadows overview' sample will crash the app: image

Exception message:

Specified cast is not valid.

Stack trace:

   at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|38_0(Int32 hr)
   at ABI.Microsoft.UI.Xaml.IFrameworkElementOverridesMethods.MeasureOverride(IObjectReference _obj, Size availableSize)
   at Microsoft.UI.Xaml.FrameworkElement.MeasureOverride(Size availableSize)
   at Microsoft.UI.Xaml.FrameworkElement.Microsoft.UI.Xaml.IFrameworkElementOverrides.MeasureOverride(Size availableSize)
   at ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_MeasureOverride_0(IntPtr thisPtr, Size availableSize, Size* result)

This behavior is not present when running the gallery under UWP.

Steps to reproduce

1. Clone the repo
2. Generate the gallery solution, include the Media component and the wasdk multitarget/head.
3. Build and deploy the wasdk gallery 
4. Navigate to the 'Shadows overview' sample page and observe crash.

Expected behavior

No crash

Screenshots

No response

Code Platform

Windows Build Number

Other Windows Build number

No response

App minimum and target SDK version

Other SDK version

No response

Visual Studio Version

No response

Visual Studio Build Number

No response

Device form factor

No response

Additional context

No response

Help us help you

Yes, I'd like to be assigned to work on this item.

Arlodotexe commented 3 days ago

This error only throws when AoT is enabled. Running without AoT works as expected:

Image

Also worth noting that this document doesn't have any embedded samples in it. This means might be an issue with the MarkdownTextBlock being used by the gallery.

Arlodotexe commented 3 days ago

We're still using 7.1.2 for the Markdown renderer in the Gallery:

These will need to be updated to the latest version of MarkdownTextBlock in Labs.