Crash when referencing resource dictionary with styles in WinUI 3 Preview 2
See original GitHub issueDescribe the bug
Run the attached project. The app just crashes, opening the exception times out.
Steps to reproduce the bug
Steps to reproduce the behavior:
- Create library with two files:
Controls.xaml
andMyControl.xaml
- Reference
MyControl.xaml
inControls.xaml
as resource dictionary - Reference
library/Controls.xaml
from a WinUI 3 UWP app - 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:
- Created 3 years ago
- Comments:9 (7 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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).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.