Skip to content

Commit 127bdc3

Browse files
committed
Add WinAppSDK 1.6 workaround. See CommunityToolkit/Labs-Windows#561 (comment)
1 parent 15e3d12 commit 127bdc3

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

MultiTarget/WinUI.Extra.props

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,4 +52,23 @@
5252
<HintPath Condition="Exists('c:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\Extensions\Xamarin.VisualStudio')">c:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\Extensions\Xamarin.VisualStudio\Xamarin.Mac.dll</HintPath>
5353
</Reference>
5454
</ItemGroup>
55+
56+
<!--
57+
Workaround for WindowsAppSdk 1.6
58+
Track https://github.com/CommunityToolkit/Labs-Windows/pull/561#issuecomment-2274727870
59+
-->
60+
<Target Condition="'$(IsWinAppSdk)' == 'true'" Name="CsWinRTRemoveXamlDllReferences" AfterTargets="ResolveTargetingPackAssets;ResolveReferences" BeforeTargets="XamlPreCompile;CoreCompile" Outputs="@(Reference)">
61+
<ItemGroup>
62+
<Reference Remove="@(Reference)"
63+
Condition="'%(Reference.Filename)%(Reference.Extension)' == 'Microsoft.Windows.UI.Xaml.dll'" />
64+
<ReferencePathWithRefAssemblies Remove="@(ReferencePathWithRefAssemblies)"
65+
Condition="'%(ReferencePathWithRefAssemblies.Filename)%(ReferencePathWithRefAssemblies.Extension)' == 'Microsoft.Windows.UI.Xaml.dll'" />
66+
<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)"
67+
Condition="'%(ReferenceCopyLocalPaths.Filename)%(ReferenceCopyLocalPaths.Extension)' == 'Microsoft.Windows.UI.Xaml.dll'" />
68+
<ReferencePath Remove="@(ReferencePath)"
69+
Condition="'%(ReferencePath.Filename)%(ReferencePath.Extension)' == 'Microsoft.Windows.UI.Xaml.dll'" />
70+
<RuntimePackAsset Remove="@(RuntimePackAsset)"
71+
Condition="'%(RuntimePackAsset.Filename)%(RuntimePackAsset.Extension)' == 'Microsoft.Windows.UI.Xaml.dll'" />
72+
</ItemGroup>
73+
</Target>
5574
</Project>

0 commit comments

Comments
 (0)