Skip to content

Instantly share code, notes, and snippets.

@yamamaya
Last active March 2, 2026 12:41
Show Gist options
  • Select an option

  • Save yamamaya/f74f629252f42bfca5801b0b7ee7267a to your computer and use it in GitHub Desktop.

Select an option

Save yamamaya/f74f629252f42bfca5801b0b7ee7267a to your computer and use it in GitHub Desktop.
How to resolve MSB3277 happen with WebView2
<Target Name="_removeUnusedWebView2" BeforeTargets="ResolveAssemblyReferences">
<ItemGroup>
<Reference Remove="@(Reference->WithMetadataValue('FileName', 'Microsoft.Web.WebView2.WinForms'))" Condition="'$(UseWindowsForms)' != 'true'" />
<Reference Remove="@(Reference->WithMetadataValue('FileName', 'Microsoft.Web.WebView2.Wpf'))" Condition="'$(UseWpf)' != 'true'" />
</ItemGroup>
</Target>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment