I am setting up a desktop bridge project with a WPF desktop app that uses Xaml Islands and Background Tasks. When building in Release mode the 'package' project generates the error: "Conflicting values for resource 'Files/App.xbf'".
The exact error messages are:
...
5>Generating native code
5>Generating fixups for native code
5>error PRI175 : 0x80073b0f - Processing Resources failed with error : Dubbele vermelding.
5>GENERATEPROJECTPRIFILE : error PRI277: 0xdef00532 - Conflicting values for resource 'Files/App.xbf'
5>Done building project "WPFXamlIslandsWithBGTask.Package.wapproj" -- FAILED.
Building in Debug mode gives no error and the app also runs successfully: the xaml user control is correctly displayed and the background task (a 15 minute Timer task) successfully fires.
I think that the error in Release mode is related with the fact that there are 2 UWP 'host' apps in the package. They are required because:
- Xaml Islands needs a UWP host app (as per Microsoft's guideline Host WinRT XAML controls in desktop apps (XAML Islands)). This app (called UWP.WinUI in my solution) is referenced by the WPF app and instantiated in the WPF's App constructor.
- The Background Task must be an out-of-process IBackgroundTask that implements the Run method and therefore also requires a UWP host app (called UWP.BGHost in my solution).
The packaging project therefore contains:
- UWP.BGHost, and
- The WPF app (which indirectly also brings in UWP.WinUI)
Any idea what is wrong here with Release mode?
Is this a Visual Studio 2019 problem? I am running VS 2019, version 16.7.7.
I made my full solution (which is really simple at this point in time) available on OneDrive (see WPFXamlIslandsWithBGTask.zip). It should give the above error when building in Release mode (x64 and x86).