Skip to content

WebView2 Not Reinitializing Correctly After App Language Change in UWP #5176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Marim99 opened this issue Mar 24, 2025 · 1 comment
Open
Assignees

Comments

@Marim99
Copy link

Marim99 commented Mar 24, 2025

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.

@ParadoxZero
Copy link

Hey @Marim99

Couple of questions -

  1. How are you changing the app's language (and webview's) - a small example would help a lot!
  2. Regarding the multiple webview2 processes. Could be other application's webview2 as well, how are you validating those were created by your app?

Overall, the description implies creation failure due to difference between environment of currently running WebView2 Manager process and the environment of the new webview being created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants