Skip to content

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

@RichieHindle

Description

@RichieHindle

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions