microsoft / microsoft/WinUI-Gallery

XamlParseException thrown when repeatedly opening a control page.

Open
#1,206 10 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug external-bug
Dominant language
C#
Stars
3.6k
Forks
756
Avg merge
17h 51m
Merged PRs (30d)
14

Description

Which version of the app?

WinUI 3 Gallery

Description
  1. Run the current build of WinUI 3 Gallery.
  2. In the navigation menu click "All" to display the grid of all controls.
  3. Click the NavigationView tile to display the NavigationViewPage

Repeat steps 2 and 3 several times (2 to 10 times usually) until a XamlParseException: 'XAML Parsing Failed.' exception is thrown within the generated (NavigationViewPage.g.i.cs) partial class InitializeComponent() method on the last line of this method:

' global::Microsoft.UI.Xaml.Application.LoadComponent(this, resourceLocator, global::Microsoft.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);'

(see screenshot below)

This same XamlParseException has also been observed with the ViewboxPage following the same steps.
This same XamlParseException has also been observed with the ViewboxPage following alternate steps clicking the Viewbox tile to open the ViewboxPage alternating with clicking almost anything else in the navigation menu. Again it happens after reopening the Viewbox page between 2 to 10 times.

Screenshots

XamlParseException

Windows version

Windows 11 22H2 (22621)

Additional context

Edition Windows 11 Home
Version 22H2
Installed on ‎1/‎5/‎2023
OS build 22621.1265
Experience Windows Feature Experience Pack 1000.22638.1000.0

Visual Studio 2022 Preview 17.6 preview 1
WindowsAppSDK 1.2.23

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the navigation sequence in WinUI 3 Gallery: open All, then NavigationViewPage repeatedly, and compare with the ViewboxPage case. Inspect the generated NavigationViewPage.g.i.cs InitializeComponent() failure and the referenced XAML resource loading. Done means both pages can be reopened repeatedly without the XamlParseException.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.