microsoft-ui-xaml
microsoft-ui-xaml copied to clipboard
Changing `ResourceDictonary` xaml file requires cleaning the project
Describe the bug
When I make changes in Resource Dictionary xaml files I have to clean the project for the changes to take effect. Hot reload doesn't work, even stopping and running the app again does not work. I have to rebuild the project that contains the xaml file.
Steps to reproduce the bug
- Create a Blank App (WinUI 3) project and a Class Library (WinUI 3)
- Make the blank app project dependent on the class library
- Move the MainWindow from the blank app project to the class library
- Add a Resource Dictionary to the class library that styles some control in MainWindow
- Changes made in the resource dictionary will only be reflected in the UI after cleaning/rebuilding the class library and running the blank app project again.
Expected behavior
- Changes should show without cleaning the project
- If hot reload is enabled changes should occur immediately
Screenshots
No response
NuGet package version
Windows App SDK 1.4.5: 1.4.240211001
Packaging type
Unpackaged
Windows version
Windows 11 version 22H2 (22621, 2022 Update)
IDE
Visual Studio 2022
Additional context
Only reason I use a Class Library project instead of putting the resource dictionary and windows/controls directly in the Blank App project is that I'm trying to open a WinUI window from a WinForm project, so I have to reference a class library containing the WinUI window (see https://github.com/microsoft/WindowsAppSDK/discussions/4203)
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you!
Closed similar issues:
- Having an invalid resource dictionary in App.xaml will crash the app (#5055), similarity score: 0.71
- Cannot locate xaml Resource file (#8691), similarity score: 0.71
Note: You can give me feedback by thumbs upping or thumbs downing this comment.