WindowsAppSDK icon indicating copy to clipboard operation
WindowsAppSDK copied to clipboard

using AppSdk's 1.8 packages (Microsoft.WindowsAppSDK.*) fail to build when a dependency references AppSdk main package

Open marticliment opened this issue 3 months ago • 8 comments

Describe the bug

Trying to build a package referencing AppSdk subpackages (even when referencing all of them) crashes with error, when other dependencies have do reference AppSdk

26>Microsoft.Windows.SDK.BuildTools.MSIX.targets(33,5): Error  : The MSIX build tools use the 'CustomBeforeMicrosoftCommonTargets' MSBuild property to wire up a custom .props file that sets some necessary properties. This .props file does not appear to have been imported correctly. This likely means that someone has also overridden 'CustomBeforeMicrosoftCommonTargets', without ensuring to also chain the import of the previously assigned .props and .targets set to that property. You can use a binlog to learn more about where that assignment was done (set the verbosity to diagnostics, and search for 'reassignment: $(CustomBeforeMicrosoftCommonTargets').

Using the base Metapackage instead (Microsoft.WindowsAppSDK) works fine.

Steps to reproduce the bug

Have a project with dependencies that depend on AppSdk: Any of the following examples work

<PackageReference Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.2.250402" />
<PackageReference Include="H.NotifyIcon.WinUI" Version="2.3.0" />

Expected behavior

Build process to work

Screenshots

No response

NuGet package version

Windows App SDK 1.8.0: 1.8.250907003

Packaging type

Unpackaged

Windows version

Windows 11 version 24H2 LTSC (26100, June Update)

IDE

Other, Visual Studio 2022

Additional context

No response

marticliment avatar Sep 09 '25 22:09 marticliment

I’m experiencing the same issue. I’m using the single meta package: <PackageReference Include="Microsoft.WindowsAppSDK.WinUI" Version="1.8.250906003" />

However, when I install the Win2D NuGet package, I encounter the following error. It looks like Win2D is still based on Windows App SDK 1.6.

ghost1372 avatar Sep 10 '25 07:09 ghost1372

@Scottj1s @RDMacLachlan is there any workaround?

ghost1372 avatar Sep 10 '25 07:09 ghost1372

When I changed a MSIX-packaged win app sdk project to an unpackaged (self containerd) project,After I installed winappsdk with nuget, I also encountered this error

nocanstillbb avatar Sep 17 '25 06:09 nocanstillbb

@ghost1372 . Did you find any workaround to make the build work with Win2D?

Leisvan avatar Oct 06 '25 22:10 Leisvan

@ghost1372 . Did you find any workaround to make the build work with Win2D?

No

ghost1372 avatar Oct 07 '25 09:10 ghost1372

<PackageReference Include="CommunityToolkit.WinUI.Controls.SettingsControls" Version="8.2.250402" />

From my testing, removing the reference to CommunityToolkit fixed this issue for me. Maybe an issue with CommunityToolkit?

This solution isn't really a solution since my app requires the SettingsControls from CommunityToolkit

ryanlua avatar Oct 23 '25 08:10 ryanlua

Potential workaround: https://github.com/microsoft/WindowsAppSDK/issues/6015#issuecomment-3549860736

manodasanW avatar Nov 19 '25 22:11 manodasanW

Thanks @manodasanW, yeah it seems like the 1.8 meta package change is a break and requires dependencies to update without your provided workaround. We're waiting on other dependencies like Win2D and XAML Behaviors to be updated before the toolkit can update to 1.8 as well. At least with the move to SemVer in 2.0, hopefully incompatibilities like these will be easier to communicate moving forward.

michael-hawker avatar Nov 24 '25 19:11 michael-hawker