Skip to content

Commit

Permalink
Correctly remove WebView2 references
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio0694 committed Sep 19, 2024
1 parent 68161fe commit 0d10cad
Showing 1 changed file with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,6 @@
<EnableXamlCompilerTargetsForUwpApps>false</EnableXamlCompilerTargetsForUwpApps>
</PropertyGroup>

<PropertyGroup>

<!--
This sample does not need WebView2, but WinAppSDK is pulling it in as a transitive NuGet
dependency. We can manually exclude the native .dll-s to avoid them being in the output.
-->
<WebView2EnableCsWinRTProjectionExcludeCoreRef>true</WebView2EnableCsWinRTProjectionExcludeCoreRef>
<WebView2NeverCopyLoaderDllToOutputDirectory>true</WebView2NeverCopyLoaderDllToOutputDirectory>
</PropertyGroup>

<!-- NativeAOT settings, and size saving options for unnecessary features (optimize for speed otherwise) -->
<PropertyGroup>
<PublishAot>true</PublishAot>
Expand All @@ -48,6 +38,13 @@

<ItemGroup>
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.1.3" />

<!--
This sample does not need WebView2, but WinAppSDK is pulling it in as a transitive NuGet
dependency. We can manually exclude all of its assets to avoid them being in the output.
This also prevents the old projections from being referenced and triggering the generator.
-->
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2739.15" IncludeAssets="none" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 0d10cad

Please sign in to comment.