microsoft / microsoft/microsoft-ui-xaml

APPX1111/APPX1112 when attempting to build a separate project with XAML and packaging with a WAP project

Open
#10,982 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-XamlCompiler bug team-Core
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

Description

### Describe the bug

In my solution, I have three projects: `Project`, `Project.UI`, and `Project (Package)`. `Project` is my main WinUI project, `Project (Package)` is my Windows Application Packaging Project, and `Project.UI` is a WinUI Class Library that contains some generic controls. `Project.UI` is referenced and used by `Project`. Similarly, `Project` is referenced by and is the entry point of `Project (Package)`.

Whenever I modify the XAML of a control in `Project.UI` and attempt to build `Project (Package)`, I get an error stating:
```
Payload contains two or more files with the same destination path 'Project.UI\Control.xbf', but they are different sizes.
```
with paths to two of the same file: `Control.xbf`; but indeed with different contents and thus sizes.

Building `Project (Package)` again, the error disappears and I am then able to launch my application. Attempting to modify the XAML of the control again results in more of the same.

Is there a property in one of my three projects that I'm missing? Or is this about something else?

### Why is this important?

I would like to immediately start and test my application without any unsolvable errors.

### Steps to reproduce the bug

1. Create a **WinUI Blank App (Packaged with Windows Application Packaging Project)** named e.g. Project.
2. Add a **WinUI Class Library** to the solution named e.g. Project.UI.
3. Optionally delete `Class1.cs`.
4. To the WinUI Class Library, add a **User Control** named e.g. Control.
5. Add a reference to the WinUI Class Library from the WinUI Blank App.
6. Build the Windows Application Packaging Project.
7. Modify the User Control (e.g. replace the `Grid` with a `StackPanel`, set `Background` to `Red`).
8. Build the Windows Application Packaging Project again.
9. Observe APPX1111 (or APPX1112) in all of its glory.

### Actual behavior

A build error occurs stating there is a contradictory duplicate of e.g. `Control.xbf` whenever I update e.g. `Control.xaml`.

### Expected behavior

Compilation and packaging should complete without any inconsistent duplicate file errors.

### Screenshots

_No response_

### NuGet package version

WinUI 3 - Windows App SDK 1.8.3: 1.8.251106002

### Windows version

Windows Insider Build (xxxxx)

### Additional context

I also have a UWP Windows Runtime Component in my solution, which is referenced by `Project`. It contains an implementation of `IBackgroundTask` that is used as an app service via `WinRT.Host.dll` (as demonstrated [here](https://github.com/Osirisoo0O/WASDKSample/tree/master/src/AppService)), but it appears to be unrelated to this issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the sequence using the Project, Project.UI, and Project (Package) projects, especially after editing Control.xaml. Start by comparing the build outputs that produce the two Control.xbf files and trace the packaging build; done means repeated XAML edits build Project (Package) without APPX1111 or APPX1112.

Written by the indexing model from the issue text.

Assessment

Domain
build-system, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.