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.

Crash when referencing resource dictionary with styles in WinUI 3 Preview 2

See original GitHub issue

Describe the bug

Run the attached project. The app just crashes, opening the exception times out.

image

WinUI3 LibraryCrash.zip

Steps to reproduce the bug

Steps to reproduce the behavior:

  1. Create library with two files: Controls.xaml and MyControl.xaml
  2. Reference MyControl.xaml in Controls.xaml as resource dictionary
  3. Reference library/Controls.xaml from a WinUI 3 UWP app
  4. Start app and observe crash.

Expected behavior

The app shouldn’t crash. Screenshots

Version Info

NuGet package version:

WinUI 3 Preview 2

Windows app type:

UWP Win32
Yes
Windows 10 version Saw the problem?
Insider Build (20226) Yes
May 2020 Update (19041)
November 2019 Update (18363)
May 2019 Update (18362)
October 2018 Update (17763)
April 2018 Update (17134)
Fall Creators Update (16299)
Creators Update (15063)
Device form factor Saw the problem?
Desktop
Xbox
Surface Hub
IoT

Additional context

This app works in UWP with WinUI 2.

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
chingucodingcommented, Nov 27, 2021

This issue also repros with WinUI 3 Desktop in WASDK 1.0. Using the ms-appx:///[libraryname]/[path-to-file] syntax instead of the path inside the library is a suitable workaround (for me at least).

0reactions
chingucodingcommented, Jun 24, 2023

Thanks for getting back to this @evelynwu-msft! This doesn’t seem to repro anymore using WASDK 1.1, closing this issue as it is fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Crashes when define only one style on a resource dictionary.
There is only one element in a resource dictionary, and that element must be Style. No crashes if an element is not Style...
Read more >
ResourceDictionary Class (Windows.UI.Xaml) - UWP
Defines a repository for XAML resources, such as styles, that your app uses. You define the resources in XAML and can then retrieve...
Read more >
WinUI XAML: Using a ResourceDictionary from another ...
Lets say the referenced project is ResourceTestLib and this library project has a folder "Styles" which has a file "_Thickness.xaml". In the app ......
Read more >
Solution does not build with VS 2019 Community 16.8.2
We have an error CS0246 (name or namespace not found) for several classes. the files not compiling are xaml RessourceDictionnary with a partial...
Read more >
ResourceDictionary.MergedDictionaries Property
Gets a collection of the ResourceDictionary dictionaries that constitute the various resource dictionaries in the merged dictionaries.
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