MicrosoftEdge / MicrosoftEdge/WebView2Feedback

[Problem/Bug]: Migrating to WebView2ConmpositionControl results in Could not load file or assembly 'Microsoft.Windows.SDK.NET, Version=10.0.17763.10

Open
#5,350 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

What happened?

We are attempting to migrate to the WebView2 composition control from the standard WebVew2 control and are getting the following runtime error:

System.IO.FileNotFoundException: 'Could not load file or assembly 'Microsoft.Windows.SDK.NET, Version=10.0.17763.10, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.'

This is from simply replacing occurrences of WebView2 with WebView2CompositionControl in both the XAML and Code. It seems the composition control has some specific dependency which we are not satisfying, however I am not sure how to resolve it.

Our project property groups looks like this:

	<PropertyGroup>
		<OutputType>WinExe</OutputType>
		<TargetFramework>net8.0-windows</TargetFramework>
		<Nullable>enable</Nullable>
		<UseWindowsForms>True</UseWindowsForms>
		<UseWPF>true</UseWPF>
		<EnableDefaultApplicationDefinition>false</EnableDefaultApplicationDefinition>
		<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
		<RootNamespace>XXX</RootNamespace>
		<AssemblyName>XXX</AssemblyName>
		<ApplicationIcon>Resources\favicon.ico</ApplicationIcon>
		<Description>XXXX</Description>
		<PackageProjectUrl>XXXX</PackageProjectUrl>
		<Platforms>AnyCPU;x64</Platforms>
		<ApplicationManifest>app.manifest</ApplicationManifest>
		<UseRidGraph>true</UseRidGraph>
		<!--<SupportedOSPlatformVersion>10.0.26100.0</SupportedOSPlatformVersion>-->
	</PropertyGroup>
Importance

Important. My app's user experience is significantly compromised.

Runtime Channel

Stable release (WebView2 Runtime), Prerelease (Edge Canary/Dev/Beta)

Runtime Version

No response

SDK Version

1.0.3405.78

Framework

WPF

Operating System

Windows 11

OS Version

26100.4946

Repro steps

Replace occurrences of WebView2 to WebView2CompositionControl in XAML and Code behind.

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.

Research direction

Start with the net8.0-windows project property group and the XAML/code-behind replacements from WebView2 to WebView2CompositionControl. Reproduce the runtime FileNotFoundException for Microsoft.Windows.SDK.NET, then determine the missing dependency or project configuration required for the composition control. Done means the WPF application launches and the composition control runs without the assembly-load error.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.