Skip to content

WebView2 fails to initialize inside VS Code on Windows 11 — printing and preview broken #5623

@Jimmy961286

Description

@Jimmy961286

What happened?

Environment:
Windows 11 Home
WebView2 Runtime: Latest Evergreen
VS Code (System Installer): Latest stable

Problem:
WebView2 fails to initialize when hosted inside Visual Studio Code. As a result:

  • Markdown preview context menu is crippled (Cut/Copy/Paste only)
  • Printing is impossible
  • WebView2 detection inside VS Code returns false

Diagnostic test inside VS Code Developer Tools:
document.documentElement.outerHTML.includes("ms-webview")
Result: false

Troubleshooting performed (none resolved the issue):

  • Full uninstall of VS Code
  • Removal of all AppContainer sandbox folders under AppData\Local\Packages
  • Removal of VS Code aliases under WindowsApps
  • Reinstall of VS Code System Installer
  • Reset integrity level of VS Code installation folder
  • Verified UAC slider at top position
  • Verified registry ConsentPromptBehaviorAdmin = 2
  • Full cold boot (Shift + Shut down)
  • Relaunch VS Code
  • WebView2 still fails to initialize

Expected behavior:
WebView2 should initialize normally inside the host application so that printing and full preview functionality work.

Actual behavior:
WebView2 never initializes. VS Code remains in a degraded mode with no printing support.

Impact:
This issue has consumed multiple days of troubleshooting. VS Code becomes significantly less useful without WebView2 functionality. This appears to be a WebView2 initialization failure triggered by Windows integrity/UAC interactions.

Importance

Blocking. My app's basic functions are not working due to this issue.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

idk

SDK Version

idk

Framework

Other

Operating System

Windows 11

OS Version

Windows 11 Home V 25H2 OS Build 26200.8655

Repro steps

With AI help, was never successful to configure the software to allow assigning a printer.
These are Microsoft products. They should easily work together w/o day of unsuccessful toiling.

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

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions