MicrosoftEdge / MicrosoftEdge/WebView2Feedback

[Problem/Bug]: WPF app that also uses Microsoft.Windows.SDK.BuildTools not possible

Open
#5,310 0 comments 0 reactions 1 assignee View on GitHub

@Navdeep-ss is already working on this.

Since Jul 16, 2025.

bug
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

What happened?

When I add the Microsoft.Windows.SDK.BuildTools to your ~\WebView2Samples\GettingStartedGuides\WPF_GettingStarted\WPFSample.csproj

  <PackageReference Include="Microsoft.Web.WebView2" />
  <PackageReference Include="Microsoft.Windows.SDK.BuildTools" />
  <PackageReference Include="Microsoft.WindowsAppSDK" />

So that I can use Microsoft.Windows.ApplicationModel.DynamicDependency.Bootstrap.TryInitialize(0x00010005, out int hresult)

The build fails.

The tag 'WebView2' does not exist in XML namespace 'clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf'. Line 22 Position 10.

Can you recommend a fix or workaround?

Importance

Blocking. My app's basic functions are not working due to this issue.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

138.0.3351.83

SDK Version

1.0.3351.48

Framework

WPF

Operating System

Windows 11

OS Version

26100.4652

Repro steps
  1. Clone https://github.com/MicrosoftEdge/WebView2Samples/tree/main/GettingStartedGuides
  2. Modify the WPFSample.csproj to add
  <PackageReference Include="Microsoft.Windows.SDK.BuildTools" />
  <PackageReference Include="Microsoft.WindowsAppSDK" />
  1. hit rebuild.
Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

No, this never worked

Last working version (if regression)

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.