-
Notifications
You must be signed in to change notification settings - Fork 55
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
reentrance error in debug mode #3677
Comments
Thanks for reporting the issue and sorry you are running into it. I've assigned this to a dev who can help follow up on this. |
@milemrkobrad , Could you help to provide your project code. It's useful for us to repro this issue. |
Webview2TestProject.zip |
Hi @milemrkobrad , I repro this issue locally. I found that the exception doesn't crush the process. It just triggers a breakpoint. So In release mode nothing will happen after aprox 20s. Just in debug mode, for some debugger reason it would throw cuz timeout. |
could not make it work using deferral , but this way, using TaskCompletionSource class seems to work fine: public async Task OpenDlgSyncCtxPost(string jsonStr)
} |
@milemrkobrad seems like you have found a solution? In that case I will be closing this issue. |
Description
When using method SynchronizationContext.Current.Send to open winform dialog from native app using js method globalThis.chrome.webview.hostObjects.dotnet.HostMethodName(JSON.stringify(objectToPass)), if dialog box is not closed, after aprox. 20 seconds app crashes with no error message. After turning on "Enable native code debugging" option in project properties I get error 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.
This only occurs in debug mode.
I am aware that there exists async method "Post" but I need sync method, because I am waiting dialog result (user action).
Version
SDK: 1.0.1901.177
Runtime: 115.0.1901.188
Framework: WinForms .NET Framework 4.8
OS: Win 10 Enterprise Built 19045
Regression
Was this working before but has regressed? no
The text was updated successfully, but these errors were encountered: