microsoft / WindowsAppSDK

The Windows App SDK empowers all Windows desktop apps with modern Windows UI, APIs, and platform features, including back-compat support, shipped via NuGet.
https://docs.microsoft.com/windows/apps/windows-app-sdk/
MIT License
3.85k stars 323 forks source link

PRI277 - App.xbf Conflict with multiple WinUI3 apps in same package #4583

Closed bkaankose closed 4 months ago

bkaankose commented 4 months ago

Describe the bug

I have 2 WinUI3 apps packaged together with Windows Packaging Project (wapproj). Building the packaging project fails with duplicate entry error

9>GENERATEPROJECTPRIFILE : error : PRI175: 0x80073b0f - Processing Resources failed with error: Duplicate Entry. 9>GENERATEPROJECTPRIFILE : error : PRI277: 0x80073b0f - Conflicting values for resource 'Files/App.xbf'

Bundling UWP and WPF (.NET8) projects together works fine though. Even though both projects had App.xaml file. Possible duplicate of #1650

Is this even possible?

Steps to reproduce the bug

  1. Create 2 different WinUI apps.

    net8.0-windows10.0.19041.0 10.0.17763.0
  2. Package them together in same packing project. (wapproj)

Expected behavior

Both WinUI apps should be packaged in the same package. Only set entry app should launch.

Screenshots

No response

NuGet package version

None

Packaging type

Packaged (MSIX)

Windows version

Windows 11 version 22H2 (22621, 2022 Update)

IDE

Visual Studio 2022-preview

Additional context

Microsoft.Windows.SDK.BuildTools 10.0.26100.1 Microsoft.WindowsAppSDK 1.5.240627000

Gaoyifei1011 commented 4 months ago

Describe the bug

I have 2 WinUI3 apps packaged together with Windows Packaging Project (wapproj). Building the packaging project fails with duplicate entry error

9>GENERATEPROJECTPRIFILE : error : PRI175: 0x80073b0f - Processing Resources failed with error: Duplicate Entry. 9>GENERATEPROJECTPRIFILE : error : PRI277: 0x80073b0f - Conflicting values for resource 'Files/App.xbf'

Bundling UWP and WPF (.NET8) projects together works fine though. Even though both projects had App.xaml file. Possible duplicate of #1650

Is this even possible?

Steps to reproduce the bug

  1. Create 2 different WinUI apps. net8.0-windows10.0.19041.0 10.0.17763.0
  2. Package them together in same packing project. (wapproj)

Expected behavior

Both WinUI apps should be packaged in the same package. Only set entry app should launch.

Screenshots

No response

NuGet package version

None

Packaging type

Packaged (MSIX)

Windows version

Windows 11 version 22H2 (22621, 2022 Update)

IDE

Visual Studio 2022-preview

Additional context

Microsoft.Windows.SDK.BuildTools 10.0.26100.1 Microsoft.WindowsAppSDK 1.5.240627000

It appears that the conflict occurred when the compiled binary App.xbf of App.xaml had the same name and path in the same package project. You can use the following solutions

  1. Use a different name for App.xaml for different projects, such as WinUIApp.xml as shown in the image below
  2. Of the different project App. Xaml on different paths, such as Project1/Folder1/App.xaml, Project2/Folder2/App.xaml

看起来似乎是在同一个打包项目中,同时拥有了相同名称和路径的 App.xaml 编译后的二进制文件 App.xbf,才发生了冲突。 您可以采用以下解决方案 1.为不同项目的 App.xaml 改用其他名称,比如下面图片所示的 WinUIApp.xml 2.将不同项目的 App.xaml 放到不同路径下,比如 Project1/Folder1/App.xaml,Project2/Folder2/App.xaml image

You can refer to the solution of my project 您可以参考我项目的解决方法 https://github.com/Gaoyifei1011/GetStoreApp

bkaankose commented 4 months ago

@Gaoyifei1011 life saver. I think renaming App.xaml didn't work for UWP but for WinAppSDK it seems to work.

Thank you.