Skip to content

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

Open
@Marim99

Description

@Marim99

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions