Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Cherry pick][WinAppSDK 1.5] Only merge PRIs from references if the project is producing an executable #4145

Conversation

evelynwu-msft
Copy link
Contributor

@evelynwu-msft evelynwu-msft commented Jan 31, 2024

(Addresses microsoft/microsoft-ui-xaml#8857)

The MRT Core targets are incorrectly merging the PRIs of references into the final PRI in all cases. Suppose you have Package A which contains some WinUI controls, which results in some XBFs being inserted as resources into its PRI. There is also a Package B that relies on Package A version 1.0. Finally, there is an App C that relies on both Package A (version 1.1) and Package B. Because Package B is including the PRI resources from Package A version 1.0 in its own PRI, when App C attempts to merge the PRI resources from all of its dependencies a conflict will arise and break the build.

Package B should not be including the PRI resources from Package A in its own PRI, and instead should advertise the dependency and allow App C to resolve it and perform the PRI resource merge itself. In the UWP targets, this was done by checking to see if the project was producing a package but since Windows App SDK needs to also handle unpackaged apps, the correct way to achieve the same goal is to check if the project is a library (i.e. not producing an executable) and not merge PRI resources from dependencies if that is the case.

Note: Libraries (including Nuget packages) affected by this bug will need to be recompiled.

Cherry-picked from #4124

@evelynwu-msft
Copy link
Contributor Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Contributor

@codendone codendone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@evelynwu-msft evelynwu-msft enabled auto-merge (squash) January 31, 2024 23:34
@evelynwu-msft evelynwu-msft merged commit 4c0fb2a into release/1.5-stable Feb 1, 2024
24 checks passed
@evelynwu-msft evelynwu-msft deleted the user/evelynwu/fix-pri-generation-for-libraries-onto-release-1.5-stable branch February 1, 2024 00:39
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants