MicrosoftEdge / MicrosoftEdge/WebView2Feedback

WebView2 Not Reinitializing Correctly After App Language Change in UWP

Open
#5,176 1 comment 0 reactions 1 assignee View on GitHub

@ParadoxZero is already working on this.

Since Mar 24, 2025.

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

Description

I'm working on a UWP application that uses WebView2 to render and print HTML content. My RegisterPrintPage method initializes the WebView2, loads HTML, and then prints it to a PDF.

Everything works fine until the app's language is changed. After switching the language, WebView2 fails to initialize properly, and WebViewControl.CoreWebView2 becomes null.

However, if I change the language back to the original setting, WebView2 works correctly again.

Here’s my implementation:

Additionally, I noticed that WebView2 instances are not closing properly. When checking Task Manager, I see multiple msedgewebview2.exe processes running even after calling CleanupWebView(). This makes me suspect that WebView2 is not fully releasing its resources.

Interestingly, if I manually kill the msedgewebview2.exe process using the command line (taskkill /F /IM msedgewebview2.exe), WebView2 starts working correctly again.

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.