using AppSdk's 1.8 packages (Microsoft.WindowsAppSDK.*) fail to build when a dependency references AppSdk main package
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
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.
@Scottj1s @RDMacLachlan is there any workaround?
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
@ghost1372 . Did you find any workaround to make the build work with Win2D?
<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
Potential workaround: https://github.com/microsoft/WindowsAppSDK/issues/6015#issuecomment-3549860736
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.