Skip to content

Commit e808f5b

Browse files
committed
Add WinAppSDK 1.6 workaround. See CommunityToolkit/Labs-Windows#561 (comment)
1 parent fad66d6 commit e808f5b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

MultiTarget/WinUI.Extra.props

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,23 @@
5959
<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>
6060
</Reference>
6161
</ItemGroup>
62+
63+
<!--
64+
Workaround for WindowsAppSdk 1.6
65+
Track https://github.com/CommunityToolkit/Labs-Windows/pull/561#issuecomment-2274727870
66+
-->
67+
<Target Condition="'$(IsWinAppSdk)' == 'true'" Name="CsWinRTRemoveXamlDllReferences" AfterTargets="ResolveTargetingPackAssets;ResolveReferences" BeforeTargets="XamlPreCompile;CoreCompile" Outputs="@(Reference)">
68+
<ItemGroup>
69+
<Reference Remove="@(Reference)"
70+
Condition="'%(Reference.Filename)%(Reference.Extension)' == 'Microsoft.Windows.UI.Xaml.dll'" />
71+
<ReferencePathWithRefAssemblies Remove="@(ReferencePathWithRefAssemblies)"
72+
Condition="'%(ReferencePathWithRefAssemblies.Filename)%(ReferencePathWithRefAssemblies.Extension)' == 'Microsoft.Windows.UI.Xaml.dll'" />
73+
<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)"
74+
Condition="'%(ReferenceCopyLocalPaths.Filename)%(ReferenceCopyLocalPaths.Extension)' == 'Microsoft.Windows.UI.Xaml.dll'" />
75+
<ReferencePath Remove="@(ReferencePath)"
76+
Condition="'%(ReferencePath.Filename)%(ReferencePath.Extension)' == 'Microsoft.Windows.UI.Xaml.dll'" />
77+
<RuntimePackAsset Remove="@(RuntimePackAsset)"
78+
Condition="'%(RuntimePackAsset.Filename)%(RuntimePackAsset.Extension)' == 'Microsoft.Windows.UI.Xaml.dll'" />
79+
</ItemGroup>
80+
</Target>
6281
</Project>

0 commit comments

Comments
 (0)