MicrosoftEdge / MicrosoftEdge/WebView2Feedback

[Problem/Bug]: The debugger message that explains event handler reentrancy and native debugging doesn't show up under Managed debugging

Open
#5,056 0 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?

Debugging a .NET app that shows a dialog in a webview2 event handler halts the process with a message:

Running a message loop synchronously in an event handler in Webview can cause reentrancy issue. Please refer to https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/threading-model#re-entrancy for more information about threading model in WebView2 and how to enable native code debugging for this scenario.

Very nice and helpful - much appreciated!

But that message, which tells you to "enable native code debugging", only appears when you've already enabled native code debugging. If you're debugging using Managed debugging, the message doesn't appear. Your app simply disappears with no explanation.

I have precious little remaining hair, and I can't afford to spend hours pulling it out when my app just quits with no explanation. For the sake of all the future Richies who might have to go through this, please make that message appear under Managed debugging!

Importance

Moderate. My app's user experience is affected, but still usable.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

131.0.2903.146

SDK Version

1.0.2903.40

Framework

WPF

Operating System

Windows 10

OS Version

19045.5371

Repro steps
  1. Write a WPF app that shows a message box in a webview2 event handler.
  2. Debug your app using Managed debugging, not Native.
  3. Show the dialog and wait a few seconds.
  4. Watch as your app just vanishes with no exception and no explanation.
  5. Wish there had been a debug message to explain what happened.
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 by reproducing the listed WPF WebView2 scenario with managed debugging on the stated runtime and SDK versions, then compare it with native debugging. Trace why the process disappears without the reentrancy guidance; done means the explanatory message also appears during managed debugging.

Written by the indexing model from the issue text.

Assessment

Domain
desktop, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.