Skip to content

Commit 83624f6

Browse files
committed
Add workaround to remove WebView2Loader.dll due to broken reference in Microsoft.Xaml.Behaviors.WinUI.Managed 3.0.0-preview1
1 parent 4fac683 commit 83624f6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

MultiTarget/WinUI.Extra.props

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@
4747
<WebView2NeverCopyLoaderDllToOutputDirectory>true</WebView2NeverCopyLoaderDllToOutputDirectory>
4848
</PropertyGroup>
4949

50+
<!-- Workaround for the latest Microsoft.Xaml.Behaviors.WinUI.Managed 3.0.0-preview1 referencing a broken version of WebView2. -->
51+
<Target Name="RemoveWebViewDlls"
52+
BeforeTargets="GetCopyToOutputDirectoryItems"
53+
AfterTargets="AddPriPayloadFilesToCopyToOutputDirectoryItems">
54+
<ItemGroup>
55+
<_ExtraPriPayloadFiles Remove="@(_ExtraPriPayloadFiles)" Condition="'%(_ExtraPriPayloadFiles.FileName)%(_ExtraPriPayloadFiles.Extension)' == 'WebView2Loader.dll'"/>
56+
<_AllChildProjectItemsWithTargetPath Remove="@(_AllChildProjectItemsWithTargetPath)" Condition="'%(_AllChildProjectItemsWithTargetPath.FileName)%(_AllChildProjectItemsWithTargetPath.Extension)' == 'WebView2Loader.dll'"/>
57+
</ItemGroup>
58+
</Target>
59+
5060
<PropertyGroup Condition="'$(IsUno)' == 'true'">
5161
<!-- Xaml Trimming: https://platform.uno/docs/articles/features/resources-trimming.html -->
5262
<UnoXamlResourcesTrimming>true</UnoXamlResourcesTrimming>

0 commit comments

Comments
 (0)