Skip to content

Commit f36651c

Browse files
committed
Add explicit WebView2 reference to prevent Microsoft.VCLibs.Desktop inclusion on UAP
1 parent 45f6f8d commit f36651c

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project>
2+
<!-- Condition must be on a <When> statement in its own file for this to work in Visual Studio. https://stackoverflow.com/a/16557059 -->
3+
<Choose>
4+
<!-- Explicit WebView2 reference needed to work around WebView2 pulling in Microsoft.VCLibs.Desktop on uap -->
5+
<When Condition="'$(HasWinUI)' == 'true' AND '$(MultiTargetPlatformIdentifier)' != 'windows'" >
6+
<ItemGroup>
7+
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2903.40" />
8+
</ItemGroup>
9+
</When>
10+
<Otherwise>
11+
</Otherwise>
12+
</Choose>
13+
</Project>

MultiTarget/WinUI.Extra.props

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,6 @@
2929
<None PackagePath="lib/net7.0-windows10.0.18362" Include="$(MSBuildThisFileDirectory)/_._" Pack="true" />
3030
</ItemGroup>
3131

32-
<!-- Fixes an issue where the WebView2 reference causes Microsoft.VCLibs.Desktop to be pulled in on uap -->
33-
<PropertyGroup Condition="'$(IsUwp)' == 'true' OR '$(MultiTargetPlatformIdentifier)' != 'windows'">
34-
<WebView2UseWinRT>false</WebView2UseWinRT>
35-
<WebView2UseDispatchAdapter>false</WebView2UseDispatchAdapter>
36-
</PropertyGroup>
37-
3832
<PropertyGroup Condition="'$(IsUwp)' == 'true'">
3933
<Platforms>x86;x64;arm64</Platforms>
4034

0 commit comments

Comments
 (0)