Skip to content

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

@clovett

Description

@clovett

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions