x86 build is broken due to Microsoft.Toolkit.Win32.UI.XamlApplication #2432

Closed
opened 2026-01-30 22:54:52 +00:00 by claunia · 9 comments
Owner

Originally created by @DHowett-MSFT on GitHub (Jul 1, 2019).

For some reason, the auxiliary Xaml toolkit's winmd is not getting ingested by the AppxManifest generator. It complains with a warning that the winmd file has no Implementation, when it does in fact have one.

Looking at a binlog of the build, it definitely has an Implementation. It may be getting stripped off somewhere. Adding the package reference directly to the WAP packaging project doesn't help.

At build time, the toolkit package looks identical to Microsoft.UI.Xaml.

Originally created by @DHowett-MSFT on GitHub (Jul 1, 2019). For some reason, the auxiliary Xaml toolkit's winmd is _not_ getting ingested by the AppxManifest generator. It complains with a warning that the winmd file has no `Implementation`, when it does in fact have one. Looking at a binlog of the build, it definitely has an `Implementation`. It may be getting stripped off somewhere. Adding the package reference directly to the WAP packaging project doesn't help. At build time, the toolkit package looks identical to Microsoft.UI.Xaml.
Author
Owner

@DHowett-MSFT commented on GitHub (Jul 1, 2019):

/cc @ocalvo

Oscar, this will likely impact other consumers of the toolkit. The end result is that the inherited XamlApplication class can't be activated because it doesn't end up listed in the .appxmanifest.

@DHowett-MSFT commented on GitHub (Jul 1, 2019): /cc @ocalvo Oscar, this will likely impact other consumers of the toolkit. The end result is that the inherited `XamlApplication` class can't be activated because it doesn't end up listed in the `.appxmanifest`.
Author
Owner

@ocalvo commented on GitHub (Jul 3, 2019):

Looking....

@DHowett-MSFT how do I repro this?

@ocalvo commented on GitHub (Jul 3, 2019): Looking.... @DHowett-MSFT how do I repro this?
Author
Owner

@DHowett-MSFT commented on GitHub (Jul 5, 2019):

Implementation is being stripped by the <RemovePayloadDuplicates> task from Microsoft.Build.AppxPackage.dll. Why? No idea yet.

@DHowett-MSFT commented on GitHub (Jul 5, 2019): `Implementation` is being stripped by the `<RemovePayloadDuplicates>` task from `Microsoft.Build.AppxPackage.dll`. _Why? No idea yet._
Author
Owner

@DHowett-MSFT commented on GitHub (Jul 5, 2019):

@ocalvo, I've got it! Check this out.

In the toolkit package targets, on line 4, we are adding a <Reference> to the .winmd. This Reference has an <Implementation>.

On line 9, we are adding a <ReferenceCopyLocalPaths> with a wildcard that also includes the .winmd! This one is a standard file reference, so it has no <Implementation>.

The Appx Packaging task RemovePayloadDuplicates is receiving a list where ReferenceCopyLocalFiles comes before References, and the .winmd reference without the Implementation wins.

If we remove the wildcard reference, the warning goes away and the appx manifest is generated with the correct activatable class entry:

    <Extension Category="windows.activatableClass.inProcessServer">
      <InProcessServer>
        <Path>Microsoft.Toolkit.Win32.UI.XamlHost.dll</Path>
        <ActivatableClass ActivatableClassId="Microsoft.Toolkit.Win32.UI.XamlHost.XamlApplication" ThreadingModel="both" />
      </InProcessServer>
    </Extension>
@DHowett-MSFT commented on GitHub (Jul 5, 2019): @ocalvo, I've got it! Check this out. In the toolkit package `targets`, on [line 4](https://github.com/windows-toolkit/Microsoft.Toolkit.Win32/blob/e308cd3ecd834632253a11158e5609968ab18c1b/Microsoft.Toolkit.Win32.UI.XamlApplication.Package/native/Microsoft.Toolkit.Win32.UI.XamlApplication.targets#L4), we are adding a `<Reference>` to the `.winmd`. This Reference has an `<Implementation>`. On [line 9](https://github.com/windows-toolkit/Microsoft.Toolkit.Win32/blob/e308cd3ecd834632253a11158e5609968ab18c1b/Microsoft.Toolkit.Win32.UI.XamlApplication.Package/native/Microsoft.Toolkit.Win32.UI.XamlApplication.targets#L9), we are adding a `<ReferenceCopyLocalPaths>` with a wildcard that _also includes the `.winmd`_! This one is a standard file reference, so it has **no** `<Implementation>`. The Appx Packaging task `RemovePayloadDuplicates` is receiving a list where `ReferenceCopyLocalFiles` comes before `References`, and the `.winmd` reference _without_ the Implementation wins. If we remove the wildcard reference, the warning goes away and the appx manifest is generated with the correct activatable class entry: ```xml <Extension Category="windows.activatableClass.inProcessServer"> <InProcessServer> <Path>Microsoft.Toolkit.Win32.UI.XamlHost.dll</Path> <ActivatableClass ActivatableClassId="Microsoft.Toolkit.Win32.UI.XamlHost.XamlApplication" ThreadingModel="both" /> </InProcessServer> </Extension> ```
Author
Owner

@azchohfi commented on GitHub (Jul 8, 2019):

Version 6.0.0-preview6.3 was just pushed.

@azchohfi commented on GitHub (Jul 8, 2019): Version 6.0.0-preview6.3 was just pushed.
Author
Owner

@DHowett-MSFT commented on GitHub (Jul 13, 2019):

image

@DHowett-MSFT commented on GitHub (Jul 13, 2019): ![image](https://user-images.githubusercontent.com/14316954/61177036-527f9280-a580-11e9-855e-6deeef71dc48.png)
Author
Owner

@lindexi commented on GitHub (Jul 28, 2021):

Fail in 6.1.2

@lindexi commented on GitHub (Jul 28, 2021): Fail in 6.1.2
Author
Owner

@zadjii-msft commented on GitHub (Jul 28, 2021):

@lindexi I'm sorry what? This issue was tracking a very specific issue in the Terminal's build tooling two years ago. Could you provide more context?

@zadjii-msft commented on GitHub (Jul 28, 2021): @lindexi I'm sorry what? This issue was tracking a very specific issue in the Terminal's build tooling _two years ago_. Could you provide more context?
Author
Owner

@lindexi commented on GitHub (Jul 29, 2021):

@zadjii-msft Sorry, I do not have a Visual Studio with English version. This is my output windows message:

图片

Package.appxmanifest : error APPX0703: 清单引用了不属于负载的一部分的文件“Microsoft.Toolkit.Win32.UI.XamlHost.dll”

Could you try me demo code: 739665b601/LaykearduchuNachairgurharhear

Building the solution in Visual Studio.

@lindexi commented on GitHub (Jul 29, 2021): @zadjii-msft Sorry, I do not have a Visual Studio with English version. This is my output windows message: ![图片](https://user-images.githubusercontent.com/16054566/127414646-c30514d9-f738-4392-81e8-b0ad98185b45.png) > Package.appxmanifest : error APPX0703: 清单引用了不属于负载的一部分的文件“Microsoft.Toolkit.Win32.UI.XamlHost.dll” Could you try me demo code: https://github.com/lindexi/lindexi_gd/tree/739665b601d4af8a021fd30960278ed7cbe2b441/LaykearduchuNachairgurharhear Building the solution in Visual Studio.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#2432