microsoft / microsoft/WinUI-Gallery
XamlParseException thrown when repeatedly opening a control page.
Nobody has claimed this yet.
- 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
- Run the current build of WinUI 3 Gallery.
- In the navigation menu click "All" to display the grid of all controls.
- 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

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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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