Search code examples
desktop-applicationwinui-3

WindowsAppSDK resource file modification requires rebuild


In WinUI 3 C++ Desktop project I am facing a problem. Every time I modify the localization resource files I need to rebuild the full project.

It's recommended to prepare a post-build command to overcome this issue.

https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/mrtcore/localize-strings

I am not sure how the MakePri.exe command works for generating the resource.pri file for an unpackaged app.


Solution

  • We can know that /ConfigXml(cf) is a Required Parameter under MakePri.exe New command. So, you need to create a new, initialized PRI config file for your project.

    While according to Loading strings in unpackaged applications,

    • The <PRICONFIG> must omit the "<packaging>" section so that all resources are bundled in a single resources.pri file. If using the default MakePri.exe configuration file created by createconfig, you need to delete the "<packaging>" section manually after it is created.